home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / System Extras Headers / AOCE Headers / OCEAuthDir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-20  |  187.1 KB  |  5,491 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        OCEAuthDir.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __OCEAUTHDIR__
  13. #define __OCEAUTHDIR__
  14.  
  15. #ifndef __APPLETALK__
  16. #include <AppleTalk.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <OSUtils.h>                                        */
  22. #endif
  23.  
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. /*    #include <SegLoad.h>                                        */
  27. #endif
  28.  
  29. #ifndef __OCE__
  30. #include "OCE.h"
  31. /*    #include <Aliases.h>                                        */
  32. /*    #include <AppleEvents.h>                                    */
  33. /*        #include <Memory.h>                                        */
  34. /*        #include <Events.h>                                        */
  35. /*            #include <Quickdraw.h>                                */
  36. /*                #include <QuickdrawText.h>                        */
  37. /*                    #include <IntlResources.h>                    */
  38. /*        #include <EPPC.h>                                        */
  39. /*            #include <PPCToolBox.h>                                */
  40. /*            #include <Processes.h>                                */
  41. /*        #include <Notification.h>                                */
  42. /*    #include <Script.h>                                            */
  43. #endif
  44.  
  45. #ifndef __OSUTILS__
  46. #endif
  47.  
  48. #ifndef __TYPES__
  49. #endif
  50.  
  51. enum  {
  52.     kRC4KeySizeInBytes            = 8,
  53.     kRefNumUnknown                = 0
  54. };
  55.  
  56. enum  {
  57.     kEnumDistinguishedNameBit,
  58.     kEnumAliasBit,
  59.     kEnumPseudonymBit,
  60.     kEnumDNodeBit,
  61.     kEnumInvisibleBit
  62. };
  63.  
  64. enum  {
  65.     kEnumDistinguishedNameMask    = 1L << kEnumDistinguishedNameBit,
  66.     kEnumAliasMask                = 1L << kEnumAliasBit,
  67.     kEnumPseudonymMask            = 1L << kEnumPseudonymBit,
  68.     kEnumDNodeMask                = 1L << kEnumDNodeBit,
  69.     kEnumInvisibleMask            = 1L << kEnumInvisibleBit
  70. };
  71.  
  72. #define kEnumAllMask (kEnumDistinguishedNameMask | kEnumAliasMask | kEnumPseudonymMask | kEnumDNodeMask | kEnumInvisibleMask)
  73.  
  74. typedef unsigned long DirEnumChoices;
  75.  
  76. /* Values of DirSortOption */
  77. enum  {
  78.     kSortByName                    = 0,
  79.     kSortByType                    = 1
  80. };
  81.  
  82. /* Values of DirSortDirection */
  83. enum  {
  84.     kSortForwards                = 0,
  85.     kSortBackwards                = 1
  86. };
  87.  
  88. /* Values of DirMatchWith */
  89. enum  {
  90.     kMatchAll,
  91.     kExactMatch,
  92.     kBeginsWith,
  93.     kEndingWith,
  94.     kContaining
  95. };
  96.  
  97. typedef unsigned char DirMatchWith;
  98.  
  99. #define kCurrentOCESortVersion 1
  100.  
  101. /*  Access controls are implemented on three levels:
  102.  *      DNode, Record, and Attribute Type levels
  103.  *  Some access control bits apply to the container itself, and some apply to its contents.
  104.  *
  105.  *  The Catalog Toolbox supports six functions.  These calls are:
  106.  *  DSGetDNodeAccessControl : to get Access Controls at the DNode level
  107.  *    DSGetRecordAccessControl  : to get Access Controls at the record level
  108.  *  DSGetAttributeAccessControl : to get Access Privileges at the attribute type level
  109.  * 
  110.  *  The GetXXXAccessControl calls will return access control masks for various categories
  111.  *  of users.  Please refer to the access control document for a description of the
  112.  *  categories of users.  In general these are:
  113.  *      ThisRecordOwner         - means the identity of the record itself
  114.  *      Friends                  - means any one of the assigned friends for the record
  115.  *      AuthenticatedInDNode     - means any valid user that is an authenticated entity
  116.  *          in the DNode in which this record is located
  117.  *      AuthenticatedInDirectory - means any valid authenticated catalog user
  118.  *      Guest                      - means an unauthenticated user.
  119.  *  Bit masks for various permitted access controls are defined below.
  120.  *
  121.  *  GetXXXAccessControl calls will return access control masks for various categories of
  122.  *  users for this record. In addition they also return the level of access controls
  123.  *  that the user (who is making the GetXXXAccessControl call) has for the DNode,
  124.  *  record, or attribute type.
  125.  *
  126.  *  For records, the access control granted will be minimum of the DNode access
  127.  *  control and record access control masks.  For example, to add an attribute type to a
  128.  *  record, a user must have access control kCreateAttributeTypes at the record and
  129.  *  DNode levels.  Similarly, at the attribute type level, access controls will be the
  130.  *  minimum of the DNode, record, and attribute type access controls.
  131.  *
  132.  *  
  133.  */  
  134.  
  135. /* access categories bit numbers */
  136. enum  {
  137.     kThisRecordOwnerBit            = 0,
  138.     kFriendsBit                    = 1,
  139.     kAuthenticatedInDNodeBit    = 2,
  140.     kAuthenticatedInDirectoryBit = 3,
  141.     kGuestBit                    = 4,
  142.     kMeBit                        = 5
  143. };
  144.  
  145. /* Values of CategoryMask */
  146. enum  {
  147.     kThisRecordOwnerMask        = (1L << kThisRecordOwnerBit),
  148.     kFriendsMask                = (1L << kFriendsBit),
  149.     kAuthenticatedInDNodeMask    = (1L << kAuthenticatedInDNodeBit),
  150.     kAuthenticatedInDirectoryMask = (1L << kAuthenticatedInDirectoryBit),
  151.     kGuestMask                    = (1L << kGuestBit),
  152.     kMeMask                        = (1L << kMeBit)
  153. };
  154.  
  155. /* access privileges bit numbers */
  156. enum  {
  157.     kSeeBit                        = 0,
  158.     kAddBit                        = 1,
  159.     kDeleteBit                    = 2,
  160.     kChangeBit                    = 3,
  161.     kRenameBit                    = 4,
  162.     kChangePrivsBit                = 5,
  163.     kSeeFoldersBit                = 6
  164. };
  165.  
  166. /* Values of AccessMask */
  167. enum  {
  168.     kSeeMask                    = (1L << kSeeBit),
  169.     kAddMask                    = (1L << kAddBit),
  170.     kDeleteMask                    = (1L << kDeleteBit),
  171.     kChangeMask                    = (1L << kChangeBit),
  172.     kRenameMask                    = (1L << kRenameBit),
  173.     kChangePrivsMask            = (1L << kChangePrivsBit),
  174.     kSeeFoldersMask                = (1L << kSeeFoldersBit)
  175. };
  176.  
  177. enum  {
  178.     kAllPrivs                    = (kSeeMask + kAddMask + kDeleteMask + kChangeMask + kRenameMask + kChangePrivsMask + kSeeFoldersMask),
  179.     kNoPrivs                    = 0
  180. };
  181.  
  182. /*
  183.  
  184. kSupportsDNodeNumberBit:
  185. If this bit is set, a DNode can be referenced using DNodeNumbers. 
  186. RecordLocationInfo can be specified using DNodeNumber and PathName component can be nil. 
  187. If this bit is not set, a DNode can be referenced only by PathName to the DNode. In the 
  188. later case DNodeNumber component inside record location info must be set to zero.
  189.  
  190. kSupportsRecordCreationIDBit:
  191. If this bit is set, a record can be referenced by specifying CreationID 
  192. in most catalog manager calls. If this bit is not set recordName and recordType are 
  193. required in the recordID specification for all catalog manager calls.
  194.  
  195. kSupportsAttributeCreationIDBit:
  196. If this bit is set, an attribute value can be obtained by specifying it's 
  197. CreationID in Lookup call staring point and also can be used in operations 
  198. like DeleteAttributeValue and ChangeAttributeValue an Attribute can be 
  199. specified by AttributeType and CreationID.
  200.  
  201. *************************************************************************
  202. Implicit assumption with creationID's and dNodeNumbers are, when supported
  203. they are persistent and will preserved across boots and life of the system.
  204. *************************************************************************
  205.  
  206. Following three bits are for determining the sort order in enumeration.
  207. kSupportsMatchAllBit:
  208. If this bit is set, enumeration of all the records is supported
  209.  
  210. kSupportsBeginsWithBit:
  211. If this bit is set, enumeration of records matching prefix (e.g. Begin with abc)
  212. is supported
  213.  
  214. kSupportsExactMatchBit:
  215. If this bit is set, existence of a record matching exact matchNameString and recordType
  216. is supported.
  217.  
  218. kSupportsEndsWithBit:
  219. If this bit is set, enumeration of records matching suffix (e.g. end with abc)
  220. is supported.
  221.  
  222. kSupportsContainsBit:
  223. If this bit is set, enumeration of records containing a matchNameString (e.g. containing abc)
  224. is supported
  225.  
  226.  
  227. Implicit assumption in all these is, a record type can be specified either as one of the above or
  228. a type list(more then one) to match exact type.
  229. The Following four bits will indicate sort ordering in enumeration.
  230.  
  231. kSupportsOrderedEnumerationBit:
  232. If this bit is set, Enumerated records or in some order possibly in name order.
  233.  
  234. kCanSupportNameOrderBit:
  235. If this is set, catalog will support sortbyName option in Enumerate.
  236.  
  237. kCanSupportTypeOrderBit:
  238. If this bit is set, catalog will support sortbyType option in enumearte.
  239.  
  240. kSupportSortBackwardsBit:
  241. If this bit is set, catalog supports backward sorting.
  242.  
  243. kSupportIndexRatioBit:
  244. If this bit is set, it indicates that enumeration will return approximate position
  245. of a record (percentile) among all records.
  246.  
  247. kSupportsEnumerationContinueBit:
  248. If this bit is set, catalog supports enumeration continue.
  249.  
  250. kSupportsLookupContinueBit:
  251. If this bit is set, catalog supports lookup continue.
  252.  
  253. kSupportsEnumerateAttributeTypeContinueBit:
  254. If this bit is set, catalog supports EnumerateAttributeType continue.
  255.  
  256. kSupportsEnumeratePseudonymContinueBit:
  257. If this bit is set, catalog supports EnumeratePseudonym continue.
  258.  
  259. kSupportsAliasesBit:
  260. If this bit is set, catalog supports create/delte/enumerate 
  261. of Alias Records.
  262.  
  263. kSupportPseudonymBit: 
  264. If this bit is set, catalog supports create/delte/enumerate of 
  265. pseudonyms for a record.
  266.  
  267. kSupportsPartialPathNameBit:
  268. If this bit is set, catalog nodes can be specified using DNodeNumber of a 
  269. intermediate DNode and a partial name starting from that DNode to the intended 
  270. DNode.
  271.  
  272. kSupportsAuthenticationBit:
  273. If this bit is set, catalog supports authentication manager calls.
  274.  
  275. kSupportsProxiesBit:
  276. If this bit is set, catalog supports proxy related calls in authentication manager. 
  277.  
  278. kSupportsFindRecordBit:
  279. If this bit is set, catalog supports find record call.
  280.  
  281. Bits and corresponding masks are as defined below.
  282. */
  283.  
  284. enum  {
  285.     kSupportsDNodeNumberBit        = 0,
  286.     kSupportsRecordCreationIDBit = 1,
  287.     kSupportsAttributeCreationIDBit = 2,
  288.     kSupportsMatchAllBit        = 3,
  289.     kSupportsBeginsWithBit        = 4,
  290.     kSupportsExactMatchBit        = 5,
  291.     kSupportsEndsWithBit        = 6,
  292.     kSupportsContainsBit        = 7,
  293.     kSupportsOrderedEnumerationBit = 8,
  294.     kCanSupportNameOrderBit        = 9,
  295.     kCanSupportTypeOrderBit        = 10,
  296.     kSupportSortBackwardsBit    = 11,
  297.     kSupportIndexRatioBit        = 12,
  298.     kSupportsEnumerationContinueBit = 13,
  299.     kSupportsLookupContinueBit    = 14,
  300.     kSupportsEnumerateAttributeTypeContinueBit = 15,
  301.     kSupportsEnumeratePseudonymContinueBit = 16,
  302.     kSupportsAliasesBit            = 17,
  303.     kSupportsPseudonymsBit        = 18,
  304.     kSupportsPartialPathNamesBit = 19,
  305.     kSupportsAuthenticationBit    = 20,
  306.     kSupportsProxiesBit            = 21,
  307.     kSupportsFindRecordBit        = 22
  308. };
  309.  
  310. /* values of DirGestalt */
  311. enum  {
  312.     kSupportsDNodeNumberMask    = 1L << kSupportsDNodeNumberBit,
  313.     kSupportsRecordCreationIDMask = 1L << kSupportsRecordCreationIDBit,
  314.     kSupportsAttributeCreationIDMask = 1L << kSupportsAttributeCreationIDBit,
  315.     kSupportsMatchAllMask        = 1L << kSupportsMatchAllBit,
  316.     kSupportsBeginsWithMask        = 1L << kSupportsBeginsWithBit,
  317.     kSupportsExactMatchMask        = 1L << kSupportsExactMatchBit,
  318.     kSupportsEndsWithMask        = 1L << kSupportsEndsWithBit,
  319.     kSupportsContainsMask        = 1L << kSupportsContainsBit,
  320.     kSupportsOrderedEnumerationMask = 1L << kSupportsOrderedEnumerationBit,
  321.     kCanSupportNameOrderMask    = 1L << kCanSupportNameOrderBit,
  322.     kCanSupportTypeOrderMask    = 1L << kCanSupportTypeOrderBit,
  323.     kSupportSortBackwardsMask    = 1L << kSupportSortBackwardsBit,
  324.     kSupportIndexRatioMask        = 1L << kSupportIndexRatioBit,
  325.     kSupportsEnumerationContinueMask = 1L << kSupportsEnumerationContinueBit,
  326.     kSupportsLookupContinueMask    = 1L << kSupportsLookupContinueBit,
  327.     kSupportsEnumerateAttributeTypeContinueMask = 1L << kSupportsEnumerateAttributeTypeContinueBit,
  328.     kSupportsEnumeratePseudonymContinueMask = 1L << kSupportsEnumeratePseudonymContinueBit,
  329.     kSupportsAliasesMask        = 1L << kSupportsAliasesBit,
  330.     kSupportsPseudonymsMask        = 1L << kSupportsPseudonymsBit,
  331.     kSupportsPartialPathNamesMask = 1L << kSupportsPartialPathNamesBit,
  332.     kSupportsAuthenticationMask    = 1L << kSupportsAuthenticationBit,
  333.     kSupportsProxiesMask        = 1L << kSupportsProxiesBit,
  334.     kSupportsFindRecordMask        = 1L << kSupportsFindRecordBit
  335. };
  336.  
  337. /* Values of AuthLocalIdentityOp */
  338. enum  {
  339.     kAuthLockLocalIdentityOp    = 1,
  340.     kAuthUnlockLocalIdentityOp    = 2,
  341.     kAuthLocalIdentityNameChangeOp = 3
  342. };
  343.  
  344. /* Values of AuthLocalIdentityLockAction */
  345. enum  {
  346.     kAuthLockPending            = 1,
  347.     kAuthLockWillBeDone            = 2
  348. };
  349.  
  350. /* Values of AuthNotifications */
  351. enum  {
  352.     kNotifyLockBit,
  353.     kNotifyUnlockBit,
  354.     kNotifyNameChangeBit
  355. };
  356.  
  357. enum  {
  358.     kNotifyLockMask                = 1L << kNotifyLockBit,
  359.     kNotifyUnlockMask            = 1L << kNotifyUnlockBit,
  360.     kNotifyNameChangeMask        = 1L << kNotifyNameChangeBit
  361. };
  362.  
  363. enum  {
  364.     kPersonalDirectoryFileCreator = 'kl03',
  365.     kPersonalDirectoryFileType    = 'pabt',
  366.     kBusinessCardFileType        = 'bust',
  367.     kDirectoryFileType            = 'dirt',
  368.     kDNodeFileType                = 'dnod',
  369.     kDirsRootFileType            = 'drtt',
  370.     kRecordFileType                = 'rcrd'
  371. };
  372.  
  373. typedef unsigned short DirSortOption;
  374.  
  375. typedef unsigned short DirSortDirection;
  376.  
  377. typedef unsigned long CategoryMask;
  378.  
  379. typedef unsigned long AccessMask;
  380.  
  381. typedef unsigned long DirGestalt;
  382.  
  383. typedef unsigned long AuthLocalIdentityOp;
  384.  
  385. typedef unsigned long AuthLocalIdentityLockAction;
  386.  
  387. typedef unsigned long AuthNotifications;
  388.  
  389. #if defined(powerc) || defined (__powerc)
  390. #pragma options align=mac68k
  391. #endif
  392. struct DNodeID {
  393.     DNodeNum                    dNodeNumber;
  394.     long                        reserved1;
  395.     RStringPtr                    name;
  396.     long                        reserved2;
  397. };
  398. #if defined(powerc) || defined(__powerc)
  399. #pragma options align=reset
  400. #endif
  401.  
  402. typedef struct DNodeID DNodeID;
  403.  
  404. #if defined(powerc) || defined (__powerc)
  405. #pragma options align=mac68k
  406. #endif
  407. struct DirEnumSpec {
  408.     DirEnumChoices                enumFlag;
  409.     unsigned short indexRatio;             /* Approx Record Position between 1 and 100 If supported, 0 If not supported */
  410.     union {
  411.         LocalRecordID                recordIdentifier;
  412.         DNodeID                        dNodeIdentifier;
  413.     }                            u;
  414. };
  415. #if defined(powerc) || defined(__powerc)
  416. #pragma options align=reset
  417. #endif
  418.  
  419. typedef struct DirEnumSpec DirEnumSpec;
  420.  
  421. #if defined(powerc) || defined (__powerc)
  422. #pragma options align=mac68k
  423. #endif
  424. struct DirMetaInfo {
  425.     unsigned long                info[4];
  426. };
  427. #if defined(powerc) || defined(__powerc)
  428. #pragma options align=reset
  429. #endif
  430.  
  431. typedef struct DirMetaInfo DirMetaInfo;
  432.  
  433. #if defined(powerc) || defined (__powerc)
  434. #pragma options align=mac68k
  435. #endif
  436. struct SLRV {
  437.     ScriptCode            script;         /*   Script code in which entries are sorted */
  438.     short                language;       /*   Language code in which entries are sorted */
  439.     short                regionCode;     /*   Region code in which entries are sorted */
  440.     short                version;        /*   version of aoce sorting software */
  441. };
  442. #if defined(powerc) || defined(__powerc)
  443. #pragma options align=reset
  444. #endif
  445.  
  446. typedef struct SLRV SLRV;
  447.  
  448. /* Catalog types and operations */
  449.  
  450. typedef unsigned long AuthIdentity;        /* unique identifier for an identity */
  451. typedef AuthIdentity LocalIdentity;        /* Umbrella LocalIdentity */
  452.  
  453. /* A DES key is 8 bytes of data */
  454. #if defined(powerc) || defined (__powerc)
  455. #pragma options align=mac68k
  456. #endif
  457. struct DESKey {
  458.     unsigned long                a;
  459.     unsigned long                b;
  460. };
  461. #if defined(powerc) || defined(__powerc)
  462. #pragma options align=reset
  463. #endif
  464.  
  465. typedef struct DESKey DESKey;
  466.  
  467. typedef Byte RC4Key[kRC4KeySizeInBytes];
  468.  
  469. typedef unsigned long AuthKeyType;
  470.  
  471. #if defined(powerc) || defined (__powerc)
  472. #pragma options align=mac68k
  473. #endif
  474. struct AuthKey {
  475.     AuthKeyType                    keyType;
  476.     union {
  477.         DESKey                        des;
  478.         RC4Key                        rc4;
  479.     }                            u;
  480. };
  481. #if defined(powerc) || defined(__powerc)
  482. #pragma options align=reset
  483. #endif
  484.  
  485. typedef struct AuthKey AuthKey;
  486. typedef AuthKey *AuthKeyPtr;
  487.  
  488. typedef union AuthParamBlock AuthParamBlock;
  489. typedef AuthParamBlock *AuthParamBlockPtr;
  490.  
  491. /*
  492.     AuthIOCompletionProcs cannot be written in or called from a high-level 
  493.     language without the help of mixed mode or assembly glue because they 
  494.     use the following parameter-passing convention:
  495.  
  496.     typedef pascal void (*AuthIOCompletionProcPtr)(AuthParamBlockPtr paramBlock);
  497.  
  498.         In:
  499.             =>     paramBlock                A0.L
  500.         Out:
  501.             none
  502. */
  503.  
  504. enum  {
  505.     uppAuthIOCompletionProcInfo        = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
  506. };
  507.  
  508. #if USESROUTINEDESCRIPTORS
  509. typedef pascal void (*AuthIOCompletionProcPtr)(AuthParamBlockPtr paramBlock);
  510.  
  511. typedef UniversalProcPtr AuthIOCompletionUPP;
  512.  
  513. #define CallAuthIOCompletionProc(userRoutine, paramBlock)  \
  514.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppAuthIOCompletionProcInfo, (paramBlock))
  515.  
  516. #define NewAuthIOCompletionProc(userRoutine)  \
  517.     (AuthIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
  518.     uppAuthIOCompletionProcInfo, GetCurrentISA())
  519.  
  520. #else
  521. typedef ProcPtr AuthIOCompletionUPP;
  522.  
  523. #define NewAuthIOCompletionProc(userRoutine)  \
  524.     (AuthIOCompletionUPP)((userRoutine))
  525.  
  526. #endif
  527.  
  528. /*
  529. This header is common to all the parameter blocks.  Clients should not directly
  530. touch any of these fields except ioCompletion.  ioCompletion is the
  531. completion routine pointer for async calls; it is ignored for sync calls.
  532. ioResult is the result code from the call.
  533. */
  534.     
  535. #define AuthParamHeader                        \
  536.     Ptr                        qLink;            \
  537.     long                    reserved1;        \
  538.     long                    reserved2;        \
  539.     AuthIOCompletionUPP    ioCompletion;        \
  540.     OSErr                    ioResult;        \
  541.     unsigned long            saveA5;            \
  542.     short                    reqCode;        \
  543.     long                    reserved[2];    \
  544.     AddrBlock                serverHint;        \
  545.     short                    dsRefNum;        \
  546.     unsigned long            callID;            \
  547.     AuthIdentity            identity;        \
  548.     long                    gReserved1;        \
  549.     long                    gReserved2;        \
  550.     long                    gReserved3;        \
  551.     long                    clientData;
  552.  
  553. /*****************************************************************************
  554.  
  555.  
  556.         Authentication Manager operations 
  557.  
  558. *****************************************************************************/
  559. /*
  560. kAuthResolveCreationID:
  561. userRecord will contain the user information whose creationID has to be
  562. returned. A client must make this call when he does not know the creaitionID.
  563. The creationID must be set to nil before making the call. The server will attempt
  564. to match the recordid's in the data base which match the user name and
  565. type in the record.  Depending on number of matchings, following
  566. results will be returned.
  567. Exactly One Match : CreationID in RecordID and also in buffer (if buffer is given)
  568. totalMatches = actualMatches = 1.
  569. > 1 Match:
  570.     Buffer is Large Enough:
  571.     totalMatches = actualMatches
  572.     Buffer will contain all the CIDs, kOCEAmbiguousMatches error.
  573. > 1 Match:
  574.     Buffer is not Large Enough:
  575.     totalMatches > actualMatches
  576.     Buffer will contain all the CIDs (equal to actualMatches), daMoreDataError error.
  577. 0 Matches:
  578.  kOCENoSuchRecord error
  579. */
  580.  
  581. #if defined(powerc) || defined (__powerc)
  582. #pragma options align=mac68k
  583. #endif
  584. struct AuthResolveCreationIDPB {
  585.     Ptr                            qLink;
  586.     long                        reserved1;
  587.     long                        reserved2;
  588.     AuthIOCompletionUPP        ioCompletion;
  589.     OSErr                        ioResult;
  590.     unsigned long                saveA5;
  591.     short                        reqCode;
  592.     long                        reserved[2];
  593.     AddrBlock                    serverHint;
  594.     short                        dsRefNum;
  595.     unsigned long                callID;
  596.     AuthIdentity                identity;
  597.     long                        gReserved1;
  598.     long                        gReserved2;
  599.     long                        gReserved3;
  600.     long                        clientData;
  601.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  602.     unsigned long                bufferLength;        /*  --> Buffer Size to hold duplicate Info */
  603.     Ptr                            buffer;                /*  --> Buffer  to hold duplicate Info */
  604.     unsigned long                totalMatches;        /* <--  Total Number of matching names found */
  605.     unsigned long                actualMatches;        /* <--  Number of matches returned in the buffer */
  606. };
  607. #if defined(powerc) || defined(__powerc)
  608. #pragma options align=reset
  609. #endif
  610.  
  611. typedef struct AuthResolveCreationIDPB AuthResolveCreationIDPB;
  612.  
  613.  
  614. /*
  615. kAuthBindSpecificIdentity:
  616. userRecord will contain the user information whose identity has to be
  617. verified. userKey will contain the userKey. An Identity is returned which
  618. binds the key and the userRecord. The identity returned can be used in the 'identity'
  619. field in the header portion (AuthDirParamHeader) for authenticating the Catalog and
  620. Authentication manager calls.
  621. */
  622.  
  623. #if defined(powerc) || defined (__powerc)
  624. #pragma options align=mac68k
  625. #endif
  626. struct AuthBindSpecificIdentityPB {
  627.     Ptr                            qLink;
  628.     long                        reserved1;
  629.     long                        reserved2;
  630.     AuthIOCompletionUPP        ioCompletion;
  631.     OSErr                        ioResult;
  632.     unsigned long                saveA5;
  633.     short                        reqCode;
  634.     long                        reserved[2];
  635.     AddrBlock                    serverHint;
  636.     short                        dsRefNum;
  637.     unsigned long                callID;
  638.     AuthIdentity                identity;
  639.     long                        gReserved1;
  640.     long                        gReserved2;
  641.     long                        gReserved3;
  642.     long                        clientData;
  643.     AuthIdentity                userIdentity;        /* <--  binding identity */
  644.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  645.     AuthKeyPtr                    userKey;            /*  --> OCE Key for the user */
  646. };
  647. #if defined(powerc) || defined(__powerc)
  648. #pragma options align=reset
  649. #endif
  650.  
  651. typedef struct AuthBindSpecificIdentityPB AuthBindSpecificIdentityPB;
  652.  
  653. /*
  654. kAuthUnbindSpecificIdentity:
  655. This call will unbind the userRecord and key which were bind earlier.
  656. */
  657.  
  658. #if defined(powerc) || defined (__powerc)
  659. #pragma options align=mac68k
  660. #endif
  661. struct AuthUnbindSpecificIdentityPB {
  662.     Ptr                            qLink;
  663.     long                        reserved1;
  664.     long                        reserved2;
  665.     AuthIOCompletionUPP        ioCompletion;
  666.     OSErr                        ioResult;
  667.     unsigned long                saveA5;
  668.     short                        reqCode;
  669.     long                        reserved[2];
  670.     AddrBlock                    serverHint;
  671.     short                        dsRefNum;
  672.     unsigned long                callID;
  673.     AuthIdentity                identity;
  674.     long                        gReserved1;
  675.     long                        gReserved2;
  676.     long                        gReserved3;
  677.     long                        clientData;
  678.     AuthIdentity                userIdentity;        /*  --> identity to be deleted */
  679. };
  680. #if defined(powerc) || defined(__powerc)
  681. #pragma options align=reset
  682. #endif
  683.  
  684. typedef struct AuthUnbindSpecificIdentityPB AuthUnbindSpecificIdentityPB;
  685.  
  686.  
  687. /*
  688. kAuthGetSpecificIdentityInfo:
  689. This call will return the userRecord for the given identity. Note: key is not
  690. returned because this would compromise security.
  691. */
  692.  
  693. #if defined(powerc) || defined (__powerc)
  694. #pragma options align=mac68k
  695. #endif
  696. struct AuthGetSpecificIdentityInfoPB {
  697.     Ptr                            qLink;
  698.     long                        reserved1;
  699.     long                        reserved2;
  700.     AuthIOCompletionUPP        ioCompletion;
  701.     OSErr                        ioResult;
  702.     unsigned long                saveA5;
  703.     short                        reqCode;
  704.     long                        reserved[2];
  705.     AddrBlock                    serverHint;
  706.     short                        dsRefNum;
  707.     unsigned long                callID;
  708.     AuthIdentity                identity;
  709.     long                        gReserved1;
  710.     long                        gReserved2;
  711.     long                        gReserved3;
  712.     long                        clientData;
  713.     AuthIdentity                userIdentity;        /*  --> identity of initiator */
  714.     RecordIDPtr                    userRecord;            /* <--  OCE name(Record) of the user */
  715. };
  716. #if defined(powerc) || defined(__powerc)
  717. #pragma options align=reset
  718. #endif
  719.  
  720. typedef struct AuthGetSpecificIdentityInfoPB AuthGetSpecificIdentityInfoPB;
  721.  
  722.  
  723. /*
  724. kAuthAddKey:
  725. userRecord will contain the user information whose identity has to be
  726. created. userKey will point to the key to be created. password points to
  727. an RString containing the password used to generate the key.
  728. */
  729.  
  730. #if defined(powerc) || defined (__powerc)
  731. #pragma options align=mac68k
  732. #endif
  733. struct AuthAddKeyPB {
  734.     Ptr                            qLink;
  735.     long                        reserved1;
  736.     long                        reserved2;
  737.     AuthIOCompletionUPP        ioCompletion;
  738.     OSErr                        ioResult;
  739.     unsigned long                saveA5;
  740.     short                        reqCode;
  741.     long                        reserved[2];
  742.     AddrBlock                    serverHint;
  743.     short                        dsRefNum;
  744.     unsigned long                callID;
  745.     AuthIdentity                identity;
  746.     long                        gReserved1;
  747.     long                        gReserved2;
  748.     long                        gReserved3;
  749.     long                        clientData;
  750.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  751.     AuthKeyPtr                    userKey;            /* <--  OCE Key for the user */
  752.     RStringPtr                    password;            /*  --> Pointer to password string */
  753. };
  754. #if defined(powerc) || defined(__powerc)
  755. #pragma options align=reset
  756. #endif
  757.  
  758. typedef struct AuthAddKeyPB AuthAddKeyPB;
  759.  
  760.  
  761. /*
  762. kAuthChangeKey:
  763. userRecord will contain the user information whose identity has to be
  764. created. userKey will point to the key to be created. password points to
  765. an RString containing the password used to generate the key.
  766. */
  767.  
  768. #if defined(powerc) || defined (__powerc)
  769. #pragma options align=mac68k
  770. #endif
  771. struct AuthChangeKeyPB {
  772.     Ptr                            qLink;
  773.     long                        reserved1;
  774.     long                        reserved2;
  775.     AuthIOCompletionUPP        ioCompletion;
  776.     OSErr                        ioResult;
  777.     unsigned long                saveA5;
  778.     short                        reqCode;
  779.     long                        reserved[2];
  780.     AddrBlock                    serverHint;
  781.     short                        dsRefNum;
  782.     unsigned long                callID;
  783.     AuthIdentity                identity;
  784.     long                        gReserved1;
  785.     long                        gReserved2;
  786.     long                        gReserved3;
  787.     long                        clientData;
  788.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  789.     AuthKeyPtr                    userKey;            /* <--  New OCE Key for the user */
  790.     RStringPtr                    password;            /*  -->Pointer to the new password string */
  791. };
  792. #if defined(powerc) || defined(__powerc)
  793. #pragma options align=reset
  794. #endif
  795.  
  796. typedef struct AuthChangeKeyPB AuthChangeKeyPB;
  797.  
  798.  
  799. /*
  800. AuthDeleteKey:
  801. userRecord will contain the user information whose Key has to be deleted.
  802. */
  803.  
  804. #if defined(powerc) || defined (__powerc)
  805. #pragma options align=mac68k
  806. #endif
  807. struct AuthDeleteKeyPB {
  808.     Ptr                            qLink;
  809.     long                        reserved1;
  810.     long                        reserved2;
  811.     AuthIOCompletionUPP        ioCompletion;
  812.     OSErr                        ioResult;
  813.     unsigned long                saveA5;
  814.     short                        reqCode;
  815.     long                        reserved[2];
  816.     AddrBlock                    serverHint;
  817.     short                        dsRefNum;
  818.     unsigned long                callID;
  819.     AuthIdentity                identity;
  820.     long                        gReserved1;
  821.     long                        gReserved2;
  822.     long                        gReserved3;
  823.     long                        clientData;
  824.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  825. };
  826. #if defined(powerc) || defined(__powerc)
  827. #pragma options align=reset
  828. #endif
  829.  
  830. typedef struct AuthDeleteKeyPB AuthDeleteKeyPB;
  831.  
  832.  
  833. /* AuthPasswordToKey: Converts an RString into a key. */
  834.  
  835. #if defined(powerc) || defined (__powerc)
  836. #pragma options align=mac68k
  837. #endif
  838. struct AuthPasswordToKeyPB {
  839.     Ptr                            qLink;
  840.     long                        reserved1;
  841.     long                        reserved2;
  842.     AuthIOCompletionUPP        ioCompletion;
  843.     OSErr                        ioResult;
  844.     unsigned long                saveA5;
  845.     short                        reqCode;
  846.     long                        reserved[2];
  847.     AddrBlock                    serverHint;
  848.     short                        dsRefNum;
  849.     unsigned long                callID;
  850.     AuthIdentity                identity;
  851.     long                        gReserved1;
  852.     long                        gReserved2;
  853.     long                        gReserved3;
  854.     long                        clientData;
  855.     RecordIDPtr                    userRecord;            /*  --> OCE name(Record) of the user */
  856.     AuthKeyPtr                    key;                /* <--  */
  857.     RStringPtr                    password;            /*  -->Pointer to the new password string */
  858. };
  859. #if defined(powerc) || defined(__powerc)
  860. #pragma options align=reset
  861. #endif
  862.  
  863. typedef struct AuthPasswordToKeyPB AuthPasswordToKeyPB;
  864.  
  865.  
  866. /*
  867. kAuthGetCredentials:
  868. userRecord will contain the user information whose identity has to be
  869. kMailDeletedMask. keyType (e.g. asDESKey) will indicate what type of key has to
  870. be deleted.
  871. */
  872.  
  873. #if defined(powerc) || defined (__powerc)
  874. #pragma options align=mac68k
  875. #endif
  876. struct AuthGetCredentialsPB {
  877.     Ptr                            qLink;
  878.     long                        reserved1;
  879.     long                        reserved2;
  880.     AuthIOCompletionUPP        ioCompletion;
  881.     OSErr                        ioResult;
  882.     unsigned long                saveA5;
  883.     short                        reqCode;
  884.     long                        reserved[2];
  885.     AddrBlock                    serverHint;
  886.     short                        dsRefNum;
  887.     unsigned long                callID;
  888.     AuthIdentity                identity;
  889.     long                        gReserved1;
  890.     long                        gReserved2;
  891.     long                        gReserved3;
  892.     long                        clientData;
  893.     AuthIdentity                userIdentity;        /*  --> identity of initiator */
  894.     RecordIDPtr                    recipient;            /*  --> OCE name of recipient */
  895.     AuthKeyPtr                    sessionKey;            /* <--  session key */
  896.     UTCTime                        expiry;                /* <--> desired/actual expiry */
  897.     unsigned long                credentialsLength;    /* <--> max/actual credentials size */
  898.     Ptr                            credentials;        /* <--  buffer where credentials are returned */
  899. };
  900. #if defined(powerc) || defined(__powerc)
  901. #pragma options align=reset
  902. #endif
  903.  
  904. typedef struct AuthGetCredentialsPB AuthGetCredentialsPB;
  905.  
  906.  
  907. /*
  908. AuthDecryptCredentialsPB:
  909. Changes:
  910. userKey is changed userIdentity.
  911. userRecord is changed to initiatorRecord. User must supply buffer
  912. to hold initiatorRecord.
  913. agentList has changed to agent. There wil be no call back.
  914. User must supply buffer to hold agent Record.
  915. An additional boolean parameter 'hasAgent' is included.
  916. Toolbox will set this if an 'Agent' record is found in the
  917. credentials. If RecordIDPtr is 'nil', no agent record will
  918. be copied. However user can examine 'hasAgent', If true user
  919. can reissue this call with apprpriate buffer for getting a recordID.
  920. agent has changed to intermediary.  User must supply buffer to hold 
  921. intermediary Record.  The toolbox will set 'hasIntermediary' if an
  922. 'intermediary' record is found in the credentials. 
  923. */
  924.  
  925. #if defined(powerc) || defined (__powerc)
  926. #pragma options align=mac68k
  927. #endif
  928. struct AuthDecryptCredentialsPB {
  929.     Ptr                            qLink;
  930.     long                        reserved1;
  931.     long                        reserved2;
  932.     AuthIOCompletionUPP        ioCompletion;
  933.     OSErr                        ioResult;
  934.     unsigned long                saveA5;
  935.     short                        reqCode;
  936.     long                        reserved[2];
  937.     AddrBlock                    serverHint;
  938.     short                        dsRefNum;
  939.     unsigned long                callID;
  940.     AuthIdentity                identity;
  941.     long                        gReserved1;
  942.     long                        gReserved2;
  943.     long                        gReserved3;
  944.     long                        clientData;
  945.     AuthIdentity                userIdentity;        /*  --> user's Identity */
  946.     RecordIDPtr                    initiatorRecord;    /* <--  OCE name of the initiator */
  947.     AuthKeyPtr                    sessionKey;            /* <--  session key */
  948.     UTCTime                        expiry;                /* <--  credentials expiry time */
  949.     unsigned long                credentialsLength;    /*  --> actual credentials size */
  950.     Ptr                            credentials;        /*  --> credentials to be decrypted */
  951.     UTCTime                        issueTime;            /* <--  credentials expiry time */
  952.     Boolean                        hasIntermediary;    /* <--  if true, An intermediary Record was found in credentials */
  953.     RecordIDPtr                    intermediary;        /* <--  recordID of the intermediary */
  954. };
  955. #if defined(powerc) || defined(__powerc)
  956. #pragma options align=reset
  957. #endif
  958.  
  959. typedef struct AuthDecryptCredentialsPB AuthDecryptCredentialsPB;
  960.  
  961. #if defined(powerc) || defined (__powerc)
  962. #pragma options align=mac68k
  963. #endif
  964. struct AuthMakeChallengePB {
  965.     Ptr                            qLink;
  966.     long                        reserved1;
  967.     long                        reserved2;
  968.     AuthIOCompletionUPP        ioCompletion;
  969.     OSErr                        ioResult;
  970.     unsigned long                saveA5;
  971.     short                        reqCode;
  972.     long                        reserved[2];
  973.     AddrBlock                    serverHint;
  974.     short                        dsRefNum;
  975.     unsigned long                callID;
  976.     AuthIdentity                identity;
  977.     long                        gReserved1;
  978.     long                        gReserved2;
  979.     long                        gReserved3;
  980.     long                        clientData;
  981.     AuthKeyPtr                    key;                    /*  --> UnEncrypted SessionKey */
  982.     Ptr                            challenge;                /* <--  Encrypted Challenge */
  983.     unsigned long                challengeBufferLength;    /*  ->length of challenge buffer */
  984.     unsigned long                challengeLength;        /*  <-length of Encrypted Challenge */
  985. };
  986. #if defined(powerc) || defined(__powerc)
  987. #pragma options align=reset
  988. #endif
  989.  
  990. typedef struct AuthMakeChallengePB AuthMakeChallengePB;
  991.  
  992. #if defined(powerc) || defined (__powerc)
  993. #pragma options align=mac68k
  994. #endif
  995. struct AuthMakeReplyPB {
  996.     Ptr                            qLink;
  997.     long                        reserved1;
  998.     long                        reserved2;
  999.     AuthIOCompletionUPP        ioCompletion;
  1000.     OSErr                        ioResult;
  1001.     unsigned long                saveA5;
  1002.     short                        reqCode;
  1003.     long                        reserved[2];
  1004.     AddrBlock                    serverHint;
  1005.     short                        dsRefNum;
  1006.     unsigned long                callID;
  1007.     AuthIdentity                identity;
  1008.     long                        gReserved1;
  1009.     long                        gReserved2;
  1010.     long                        gReserved3;
  1011.     long                        clientData;
  1012.     AuthKeyPtr                    key;                /*  --> UnEncrypted SessionKey */
  1013.     Ptr                            challenge;            /*  --> Encrypted Challenge */
  1014.     Ptr                            reply;                /* <--  Encrypted Reply */
  1015.     unsigned long                replyBufferLength;    /*  -->length of challenge buffer */
  1016.     unsigned long                challengeLength;    /*  --> length of Encrypted Challenge */
  1017.     unsigned long                replyLength;        /* <--  length of Encrypted Reply */
  1018. };
  1019. #if defined(powerc) || defined(__powerc)
  1020. #pragma options align=reset
  1021. #endif
  1022.  
  1023. typedef struct AuthMakeReplyPB AuthMakeReplyPB;
  1024.  
  1025. #if defined(powerc) || defined (__powerc)
  1026. #pragma options align=mac68k
  1027. #endif
  1028. struct AuthVerifyReplyPB {
  1029.     Ptr                            qLink;
  1030.     long                        reserved1;
  1031.     long                        reserved2;
  1032.     AuthIOCompletionUPP        ioCompletion;
  1033.     OSErr                        ioResult;
  1034.     unsigned long                saveA5;
  1035.     short                        reqCode;
  1036.     long                        reserved[2];
  1037.     AddrBlock                    serverHint;
  1038.     short                        dsRefNum;
  1039.     unsigned long                callID;
  1040.     AuthIdentity                identity;
  1041.     long                        gReserved1;
  1042.     long                        gReserved2;
  1043.     long                        gReserved3;
  1044.     long                        clientData;
  1045.     AuthKeyPtr                    key;                /*  --> UnEncrypted SessionKey */
  1046.     Ptr                            challenge;            /*  --> Encrypted Challenge */
  1047.     Ptr                            reply;                /*  --> Encrypted Reply */
  1048.     unsigned long                challengeLength;    /*  --> length of Encrypted Challenge */
  1049.     unsigned long                replyLength;        /*  --> length of Encrypted Reply */
  1050. };
  1051. #if defined(powerc) || defined(__powerc)
  1052. #pragma options align=reset
  1053. #endif
  1054.  
  1055. typedef struct AuthVerifyReplyPB AuthVerifyReplyPB;
  1056.  
  1057.  
  1058. /*
  1059. kAuthGetUTCTime:
  1060. RLI will contain a valid RLI for a cluster server.
  1061. UTC(GMT) time from one of the cluster server will be returned.
  1062. An 'offSet' from UTC(GMT) to Mac Local Time will also be returned.
  1063. If RLI is nil Map DA is used to determine UTC(GMT).
  1064. Mac Local Time = theUTCTime + theUTCOffset.
  1065. */
  1066.  
  1067. #if defined(powerc) || defined (__powerc)
  1068. #pragma options align=mac68k
  1069. #endif
  1070. struct AuthGetUTCTimePB {
  1071.     Ptr                            qLink;
  1072.     long                        reserved1;
  1073.     long                        reserved2;
  1074.     AuthIOCompletionUPP        ioCompletion;
  1075.     OSErr                        ioResult;
  1076.     unsigned long                saveA5;
  1077.     short                        reqCode;
  1078.     long                        reserved[2];
  1079.     AddrBlock                    serverHint;
  1080.     short                        dsRefNum;
  1081.     unsigned long                callID;
  1082.     AuthIdentity                identity;
  1083.     long                        gReserved1;
  1084.     long                        gReserved2;
  1085.     long                        gReserved3;
  1086.     long                        clientData;
  1087.     PackedRLIPtr                pRLI;                /*  --> packed RLI of the Node, whose server's UTC is requested */
  1088.     UTCTime                        theUTCTime;            /* <--  current UTC(GMT) Time utc seconds since 1/1/1904 */
  1089.     UTCOffset                    theUTCOffset;        /* <--  offset from UTC(GMT) seconds EAST of Greenwich */
  1090. };
  1091. #if defined(powerc) || defined(__powerc)
  1092. #pragma options align=reset
  1093. #endif
  1094.  
  1095. typedef struct AuthGetUTCTimePB AuthGetUTCTimePB;
  1096.  
  1097.  
  1098. /*
  1099. kAuthMakeProxy:
  1100. A user represented bu the 'userIdentity' can make a proxy using this call.
  1101. 'recipient' is the RecordID of the recipient whom user is requesting proxy.
  1102. 'intermediary' is the RecordID of the intermediary holding proxy for the user.
  1103. 'firstValid' is time at which proxy becomes valid.
  1104. 'expiry' is the time at which proxy must expire.
  1105. 'proxyLength' will have the length of the buffer pointed by 'proxy' as input.
  1106. When the call completes, it will hold the actual length of proxy. If the
  1107. call completes 'kOCEMoreData' error, client can reissue the call with the
  1108. buffer size as 'proxyLength' returned.
  1109. expiry is a suggestion, and may be adjusted to be earlier by the ADAP/OCE server.
  1110. The 'proxy' obtained like this might be used by the 'intermediary' to obtain credentials
  1111. for the server using TradeProxyForCredentials call.
  1112. authDataLength and authData are intended for possible future work, but are
  1113. ignored for now.
  1114. */
  1115.  
  1116. #if defined(powerc) || defined (__powerc)
  1117. #pragma options align=mac68k
  1118. #endif
  1119. struct AuthMakeProxyPB {
  1120.     Ptr                            qLink;
  1121.     long                        reserved1;
  1122.     long                        reserved2;
  1123.     AuthIOCompletionUPP        ioCompletion;
  1124.     OSErr                        ioResult;
  1125.     unsigned long                saveA5;
  1126.     short                        reqCode;
  1127.     long                        reserved[2];
  1128.     AddrBlock                    serverHint;
  1129.     short                        dsRefNum;
  1130.     unsigned long                callID;
  1131.     AuthIdentity                identity;
  1132.     long                        gReserved1;
  1133.     long                        gReserved2;
  1134.     long                        gReserved3;
  1135.     long                        clientData;
  1136.     AuthIdentity                userIdentity;        /*  --> identity of principal */
  1137.     RecordIDPtr                    recipient;            /*  --> OCE name of recipient */
  1138.     UTCTime                        firstValid;            /*  --> time at which proxy becomes valid */
  1139.     UTCTime                        expiry;                /*  --> time at which proxy expires */
  1140.     unsigned long                authDataLength;        /*  --> size of authorization data */
  1141.     Ptr                            authData;            /*  --> pointer to authorization data */
  1142.     unsigned long                proxyLength;        /* <--> max/actual proxy size */
  1143.     Ptr                            proxy;                /* <--> buffer where proxy is returned */
  1144.     RecordIDPtr                    intermediary;        /*  --> RecordID of intermediary */
  1145. };
  1146. #if defined(powerc) || defined(__powerc)
  1147. #pragma options align=reset
  1148. #endif
  1149.  
  1150. typedef struct AuthMakeProxyPB AuthMakeProxyPB;
  1151.  
  1152.  
  1153. /*
  1154. kAuthTradeProxyForCredentials:
  1155. Using this call, intermediary holding a 'proxy' for a recipient may obtain credentials
  1156. for that recipient. 'userIdentity' is the identity for the 'intermediary'.
  1157. 'recipient' is the RecordID for whom credetials are requested.
  1158. 'principal' is the RecordID of the user who created the proxy.
  1159. 'proxyLength' is the length of data pointed by 'proxy.
  1160. If the call is succesfull, credentials will be returned in the
  1161. buffer pointed by 'credentials'. 'expiry' is the desired expiry time at input.
  1162. When call succeds this will have expiry time of credentials.
  1163. This is very similar to GetCredentials except that we (of course) need the proxy,
  1164. but we also need the name of the principal who created the proxy.
  1165. */
  1166.  
  1167. #if defined(powerc) || defined (__powerc)
  1168. #pragma options align=mac68k
  1169. #endif
  1170. struct AuthTradeProxyForCredentialsPB {
  1171.     Ptr                            qLink;
  1172.     long                        reserved1;
  1173.     long                        reserved2;
  1174.     AuthIOCompletionUPP        ioCompletion;
  1175.     OSErr                        ioResult;
  1176.     unsigned long                saveA5;
  1177.     short                        reqCode;
  1178.     long                        reserved[2];
  1179.     AddrBlock                    serverHint;
  1180.     short                        dsRefNum;
  1181.     unsigned long                callID;
  1182.     AuthIdentity                identity;
  1183.     long                        gReserved1;
  1184.     long                        gReserved2;
  1185.     long                        gReserved3;
  1186.     long                        clientData;
  1187.     AuthIdentity                userIdentity;        /*  --> identity of intermediary */
  1188.     RecordIDPtr                    recipient;            /*  --> OCE name of recipient */
  1189.     AuthKeyPtr                    sessionKey;            /* <--  session key */
  1190.     UTCTime                        expiry;                /* <--> desired/actual expiry */
  1191.     unsigned long                credentialsLength;    /* <--> max/actual credentials size */
  1192.     Ptr                            credentials;        /* <--> buffer where credentials are returned */
  1193.     unsigned long                proxyLength;        /*  --> actual proxy size */
  1194.     Ptr                            proxy;                /*  --> buffer containing proxy */
  1195.     RecordIDPtr                    principal;            /*  --> RecordID of principal */
  1196. };
  1197. #if defined(powerc) || defined(__powerc)
  1198. #pragma options align=reset
  1199. #endif
  1200.  
  1201. typedef struct AuthTradeProxyForCredentialsPB AuthTradeProxyForCredentialsPB;
  1202.  
  1203. /* API for Local Identity Interface */
  1204. /*
  1205. AuthGetLocalIdentityPB:
  1206. A Collaborative application intended to work under the umbrella of LocalIdentity
  1207. for the OCE toolbox will have to make this call to obtain LocalIdentity.
  1208. If LocalIdentity has not been setup, then application will get
  1209. 'kOCEOCESetupRequired.'. In this case application should put the dialog
  1210. recommended by the OCE Setup document and guide the user through OCE Setup.
  1211. If the OCESetup contains local identity, but user has not unlocked, it will get
  1212. kOCELocalAuthenticationFail. In this case application should use SDPPromptForLocalIdentity
  1213. to prompt user for the password.
  1214. If a backGround application or stand alone code requires LocalIdentity, if it gets the
  1215. OSErr from LocalIdentity and can not call SDPPromptForLocalIdentity, it should it self
  1216. register with the toolbox using kAuthAddToLocalIdentityQueue call. It will be notified
  1217. when a LocalIdentity gets created by a foreground application.
  1218. */
  1219.  
  1220. #if defined(powerc) || defined (__powerc)
  1221. #pragma options align=mac68k
  1222. #endif
  1223. struct AuthGetLocalIdentityPB {
  1224.     Ptr                            qLink;
  1225.     long                        reserved1;
  1226.     long                        reserved2;
  1227.     AuthIOCompletionUPP        ioCompletion;
  1228.     OSErr                        ioResult;
  1229.     unsigned long                saveA5;
  1230.     short                        reqCode;
  1231.     long                        reserved[2];
  1232.     AddrBlock                    serverHint;
  1233.     short                        dsRefNum;
  1234.     unsigned long                callID;
  1235.     AuthIdentity                identity;
  1236.     long                        gReserved1;
  1237.     long                        gReserved2;
  1238.     long                        gReserved3;
  1239.     long                        clientData;
  1240.     LocalIdentity                theLocalIdentity;
  1241. };
  1242. #if defined(powerc) || defined(__powerc)
  1243. #pragma options align=reset
  1244. #endif
  1245.  
  1246. typedef struct AuthGetLocalIdentityPB AuthGetLocalIdentityPB;
  1247.  
  1248. /*
  1249. kAuthUnlockLocalIdentity:
  1250. The LocalIdentity can be created using this call.
  1251. The userName and password correspond to the LocalIdentity setup.
  1252. If the password matches, then collabIdentity will be returned.
  1253. Typically SDPPromptForLocalIdentity call will make this call.
  1254. All applications which are registered through kAuthAddToLocalIdentityQueue
  1255. will be notified.
  1256. */
  1257.  
  1258. #if defined(powerc) || defined (__powerc)
  1259. #pragma options align=mac68k
  1260. #endif
  1261. struct AuthUnlockLocalIdentityPB {
  1262.     Ptr                            qLink;
  1263.     long                        reserved1;
  1264.     long                        reserved2;
  1265.     AuthIOCompletionUPP        ioCompletion;
  1266.     OSErr                        ioResult;
  1267.     unsigned long                saveA5;
  1268.     short                        reqCode;
  1269.     long                        reserved[2];
  1270.     AddrBlock                    serverHint;
  1271.     short                        dsRefNum;
  1272.     unsigned long                callID;
  1273.     AuthIdentity                identity;
  1274.     long                        gReserved1;
  1275.     long                        gReserved2;
  1276.     long                        gReserved3;
  1277.     long                        clientData;
  1278.     LocalIdentity                theLocalIdentity;
  1279.     RStringPtr                    userName;
  1280.     RStringPtr                    password;
  1281. };
  1282. #if defined(powerc) || defined(__powerc)
  1283. #pragma options align=reset
  1284. #endif
  1285.  
  1286. typedef struct AuthUnlockLocalIdentityPB AuthUnlockLocalIdentityPB;
  1287.  
  1288. /*
  1289. kAuthLockLocalIdentity:
  1290. With this call existing LocalIdentity can be locked. If the ASDeleteLocalIdetity
  1291. call fails with 'kOCEOperationDenied' error, name will contain the application which
  1292. denied the operation. This name will be supplied by the application
  1293. when it registered through kAuthAddToLocalIdentityQueue call
  1294. */
  1295.  
  1296. #if defined(powerc) || defined (__powerc)
  1297. #pragma options align=mac68k
  1298. #endif
  1299. struct AuthLockLocalIdentityPB {
  1300.     Ptr                            qLink;
  1301.     long                        reserved1;
  1302.     long                        reserved2;
  1303.     AuthIOCompletionUPP        ioCompletion;
  1304.     OSErr                        ioResult;
  1305.     unsigned long                saveA5;
  1306.     short                        reqCode;
  1307.     long                        reserved[2];
  1308.     AddrBlock                    serverHint;
  1309.     short                        dsRefNum;
  1310.     unsigned long                callID;
  1311.     AuthIdentity                identity;
  1312.     long                        gReserved1;
  1313.     long                        gReserved2;
  1314.     long                        gReserved3;
  1315.     long                        clientData;
  1316.     LocalIdentity                theLocalIdentity;
  1317.     StringPtr                    name;    /* <--  name of the app which denied delete */
  1318. };
  1319. #if defined(powerc) || defined(__powerc)
  1320. #pragma options align=reset
  1321. #endif
  1322.  
  1323. typedef struct AuthLockLocalIdentityPB AuthLockLocalIdentityPB;
  1324.  
  1325. typedef pascal Boolean (*NotificationProcPtr)(long clientData, AuthLocalIdentityOp callValue, AuthLocalIdentityLockAction actionValue, LocalIdentity identity);
  1326.  
  1327. enum {
  1328.     uppNotificationProcInfo = kPascalStackBased
  1329.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  1330.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  1331.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AuthLocalIdentityOp)))
  1332.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AuthLocalIdentityLockAction)))
  1333.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(LocalIdentity)))
  1334. };
  1335.  
  1336. #if USESROUTINEDESCRIPTORS
  1337. typedef UniversalProcPtr NotificationUPP;
  1338.  
  1339. #define CallNotificationProc(userRoutine, clientData, callValue, actionValue, identity)        \
  1340.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppNotificationProcInfo, (clientData), (callValue), (actionValue), (identity))
  1341. #define NewNotificationProc(userRoutine)        \
  1342.         (NotificationUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNotificationProcInfo, GetCurrentISA())
  1343. #else
  1344. typedef NotificationProcPtr NotificationUPP;
  1345.  
  1346. #define CallNotificationProc(userRoutine, clientData, callValue, actionValue, identity)        \
  1347.         (*(userRoutine))((clientData), (callValue), (actionValue), (identity))
  1348. #define NewNotificationProc(userRoutine)        \
  1349.         (NotificationUPP)(userRoutine)
  1350. #endif
  1351.  
  1352. typedef NotificationUPP NotificationProc;
  1353.  
  1354. /*
  1355. kAuthAddToLocalIdentityQueue:
  1356. An application requiring notification of locking/unlocking of the
  1357. LocalIdentity can install itself using this call. The function provided
  1358. in 'notifyProc' will be called whenever the requested event happens.
  1359. When an AuthLockLocalIdentity call is made to the toolbox, the notificationProc
  1360. will be called with 'kAuthLockPending'. The application may refuse the lock by returning
  1361. a 'true' value. If all the registered entries return 'false' value, locking will be done
  1362. successfully. Otherwise 'kOCEOperationDenied' error is returned to the caller. The appName
  1363. (registered with the notificationProc) of the application which denied locking is also
  1364. returned to the caller making the AuthLockIdentity call.
  1365. */
  1366.  
  1367. #if defined(powerc) || defined (__powerc)
  1368. #pragma options align=mac68k
  1369. #endif
  1370. struct AuthAddToLocalIdentityQueuePB {
  1371.     Ptr                            qLink;
  1372.     long                        reserved1;
  1373.     long                        reserved2;
  1374.     AuthIOCompletionUPP        ioCompletion;
  1375.     OSErr                        ioResult;
  1376.     unsigned long                saveA5;
  1377.     short                        reqCode;
  1378.     long                        reserved[2];
  1379.     AddrBlock                    serverHint;
  1380.     short                        dsRefNum;
  1381.     unsigned long                callID;
  1382.     AuthIdentity                identity;
  1383.     long                        gReserved1;
  1384.     long                        gReserved2;
  1385.     long                        gReserved3;
  1386.     long                        clientData;
  1387.     NotificationProc            notifyProc;
  1388.     AuthNotifications            notifyFlags;
  1389.     StringPtr                    appName;    /*  --> name of application to be returned in Delete/Stop */
  1390. };
  1391. #if defined(powerc) || defined(__powerc)
  1392. #pragma options align=reset
  1393. #endif
  1394.  
  1395. typedef struct AuthAddToLocalIdentityQueuePB AuthAddToLocalIdentityQueuePB;
  1396.  
  1397. /*
  1398. kAuthRemoveFromLocalIdentityQueue:*/
  1399.  
  1400. #if defined(powerc) || defined (__powerc)
  1401. #pragma options align=mac68k
  1402. #endif
  1403. struct AuthRemoveFromLocalIdentityQueuePB {
  1404.     Ptr                            qLink;
  1405.     long                        reserved1;
  1406.     long                        reserved2;
  1407.     AuthIOCompletionUPP        ioCompletion;
  1408.     OSErr                        ioResult;
  1409.     unsigned long                saveA5;
  1410.     short                        reqCode;
  1411.     long                        reserved[2];
  1412.     AddrBlock                    serverHint;
  1413.     short                        dsRefNum;
  1414.     unsigned long                callID;
  1415.     AuthIdentity                identity;
  1416.     long                        gReserved1;
  1417.     long                        gReserved2;
  1418.     long                        gReserved3;
  1419.     long                        clientData;
  1420.     NotificationProc            notifyProc;
  1421. };
  1422. #if defined(powerc) || defined(__powerc)
  1423. #pragma options align=reset
  1424. #endif
  1425.  
  1426. typedef struct AuthRemoveFromLocalIdentityQueuePB AuthRemoveFromLocalIdentityQueuePB;
  1427.  
  1428. /*
  1429. kAuthSetupLocalIdentity:
  1430. The LocalIdentity can be Setup using this call.
  1431. The userName and password correspond to the LocalIdentity setup.
  1432. If a LocalIdentity Setup already exists 'kOCELocalIdentitySetupExists' error
  1433. will be returned.
  1434. */
  1435.  
  1436. #if defined(powerc) || defined (__powerc)
  1437. #pragma options align=mac68k
  1438. #endif
  1439. struct AuthSetupLocalIdentityPB {
  1440.     Ptr                            qLink;
  1441.     long                        reserved1;
  1442.     long                        reserved2;
  1443.     AuthIOCompletionUPP        ioCompletion;
  1444.     OSErr                        ioResult;
  1445.     unsigned long                saveA5;
  1446.     short                        reqCode;
  1447.     long                        reserved[2];
  1448.     AddrBlock                    serverHint;
  1449.     short                        dsRefNum;
  1450.     unsigned long                callID;
  1451.     AuthIdentity                identity;
  1452.     long                        gReserved1;
  1453.     long                        gReserved2;
  1454.     long                        gReserved3;
  1455.     long                        clientData;
  1456.     long                        aReserved;
  1457.     RStringPtr                    userName;
  1458.     RStringPtr                    password;
  1459. };
  1460. #if defined(powerc) || defined(__powerc)
  1461. #pragma options align=reset
  1462. #endif
  1463.  
  1464. typedef struct AuthSetupLocalIdentityPB AuthSetupLocalIdentityPB;
  1465.  
  1466. /*
  1467. kAuthChangeLocalIdentity:
  1468. An existing LocalIdentity  Setup can be changed using this call.
  1469. The userName and password correspond to the LocalIdentity setup.
  1470. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1471. will be returned. The user can use  kAuthSetupLocalIdentity call to setit up.
  1472. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1473. OSErr will be returned. If successful, LocalID will have new name as 'userName' and
  1474. password as 'newPassword' and if any applications has installed into 
  1475. LocalIdentityQueue with kNotifyNameChangeMask set, it will be notified with 
  1476. kAuthLocalIdentityNameChangeOp action value. 
  1477.  
  1478. */
  1479.  
  1480. #if defined(powerc) || defined (__powerc)
  1481. #pragma options align=mac68k
  1482. #endif
  1483. struct AuthChangeLocalIdentityPB {
  1484.     Ptr                            qLink;
  1485.     long                        reserved1;
  1486.     long                        reserved2;
  1487.     AuthIOCompletionUPP        ioCompletion;
  1488.     OSErr                        ioResult;
  1489.     unsigned long                saveA5;
  1490.     short                        reqCode;
  1491.     long                        reserved[2];
  1492.     AddrBlock                    serverHint;
  1493.     short                        dsRefNum;
  1494.     unsigned long                callID;
  1495.     AuthIdentity                identity;
  1496.     long                        gReserved1;
  1497.     long                        gReserved2;
  1498.     long                        gReserved3;
  1499.     long                        clientData;
  1500.     long                        aReserved;
  1501.     RStringPtr                    userName;
  1502.     RStringPtr                    password;
  1503.     RStringPtr                    newPassword;
  1504. };
  1505. #if defined(powerc) || defined(__powerc)
  1506. #pragma options align=reset
  1507. #endif
  1508.  
  1509. typedef struct AuthChangeLocalIdentityPB AuthChangeLocalIdentityPB;
  1510.  
  1511. /*
  1512. kAuthRemoveLocalIdentity:
  1513. An existing LocalIdentity  Setup can be removed using this call.
  1514. The userName and password correspond to the LocalIdentity setup.
  1515. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1516. will be returned.
  1517. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1518. OSErr will be returned. If successful, LocalIdentity will be removed from the OCE Setup.
  1519. This is a very distructive operation, user must be warned enough before actually making
  1520. this call.
  1521. */
  1522.  
  1523. #if defined(powerc) || defined (__powerc)
  1524. #pragma options align=mac68k
  1525. #endif
  1526. struct AuthRemoveLocalIdentityPB {
  1527.     Ptr                            qLink;
  1528.     long                        reserved1;
  1529.     long                        reserved2;
  1530.     AuthIOCompletionUPP        ioCompletion;
  1531.     OSErr                        ioResult;
  1532.     unsigned long                saveA5;
  1533.     short                        reqCode;
  1534.     long                        reserved[2];
  1535.     AddrBlock                    serverHint;
  1536.     short                        dsRefNum;
  1537.     unsigned long                callID;
  1538.     AuthIdentity                identity;
  1539.     long                        gReserved1;
  1540.     long                        gReserved2;
  1541.     long                        gReserved3;
  1542.     long                        clientData;
  1543.     long                        aReserved;
  1544.     RStringPtr                    userName;
  1545.     RStringPtr                    password;
  1546. };
  1547. #if defined(powerc) || defined(__powerc)
  1548. #pragma options align=reset
  1549. #endif
  1550.  
  1551. typedef struct AuthRemoveLocalIdentityPB AuthRemoveLocalIdentityPB;
  1552.  
  1553. /*
  1554. kOCESetupAddDirectoryInfo:
  1555. Using this call identity for a catalog can be setup under LocalIdentity umbrella.
  1556. ASCreateLocalIdentity should have been done succesfully before making this call.
  1557. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1558. DirAddDSAMDirectory call was made.
  1559. rid-> is the recordID in which the identity for the catalog will be established.
  1560. password-> the password associated with the rid in the catalog world.
  1561. */
  1562.  
  1563. #if defined(powerc) || defined (__powerc)
  1564. #pragma options align=mac68k
  1565. #endif
  1566. struct OCESetupAddDirectoryInfoPB {
  1567.     Ptr                            qLink;
  1568.     long                        reserved1;
  1569.     long                        reserved2;
  1570.     AuthIOCompletionUPP        ioCompletion;
  1571.     OSErr                        ioResult;
  1572.     unsigned long                saveA5;
  1573.     short                        reqCode;
  1574.     long                        reserved[2];
  1575.     AddrBlock                    serverHint;
  1576.     short                        dsRefNum;
  1577.     unsigned long                callID;
  1578.     AuthIdentity                identity;
  1579.     long                        gReserved1;
  1580.     long                        gReserved2;
  1581.     long                        gReserved3;
  1582.     long                        clientData;
  1583.     CreationID                    directoryRecordCID;
  1584.     RecordIDPtr                    recordID;
  1585.     RStringPtr                    password;
  1586. };
  1587. #if defined(powerc) || defined(__powerc)
  1588. #pragma options align=reset
  1589. #endif
  1590.  
  1591. typedef struct OCESetupAddDirectoryInfoPB OCESetupAddDirectoryInfoPB;
  1592.  
  1593. /*
  1594. kOCESetupChangeDirectoryInfo:
  1595. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1596. can be changed.
  1597. ASCreateLocalIdentity should have been done succesfully before making this call.
  1598. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1599. DirAddDSAMDirectory call was made.
  1600. rid-> is the recordID in which the identity for the catalog will be established.
  1601. password-> the password associated with the rid in the catalog world.
  1602. newPassword -> the new password for the catalog
  1603. */
  1604.  
  1605. #if defined(powerc) || defined (__powerc)
  1606. #pragma options align=mac68k
  1607. #endif
  1608. struct OCESetupChangeDirectoryInfoPB {
  1609.     Ptr                            qLink;
  1610.     long                        reserved1;
  1611.     long                        reserved2;
  1612.     AuthIOCompletionUPP        ioCompletion;
  1613.     OSErr                        ioResult;
  1614.     unsigned long                saveA5;
  1615.     short                        reqCode;
  1616.     long                        reserved[2];
  1617.     AddrBlock                    serverHint;
  1618.     short                        dsRefNum;
  1619.     unsigned long                callID;
  1620.     AuthIdentity                identity;
  1621.     long                        gReserved1;
  1622.     long                        gReserved2;
  1623.     long                        gReserved3;
  1624.     long                        clientData;
  1625.     CreationID                    directoryRecordCID;
  1626.     RecordIDPtr                    recordID;
  1627.     RStringPtr                    password;
  1628.     RStringPtr                    newPassword;
  1629. };
  1630. #if defined(powerc) || defined(__powerc)
  1631. #pragma options align=reset
  1632. #endif
  1633.  
  1634. typedef struct OCESetupChangeDirectoryInfoPB OCESetupChangeDirectoryInfoPB;
  1635.  
  1636. /*
  1637. kOCESetupRemoveDirectoryInfo:
  1638. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1639. can be changed.
  1640. ASCreateLocalIdentity should have been done succesfully before making this call.
  1641. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1642. */
  1643.  
  1644. #if defined(powerc) || defined (__powerc)
  1645. #pragma options align=mac68k
  1646. #endif
  1647. struct OCESetupRemoveDirectoryInfoPB {
  1648.     Ptr                            qLink;
  1649.     long                        reserved1;
  1650.     long                        reserved2;
  1651.     AuthIOCompletionUPP        ioCompletion;
  1652.     OSErr                        ioResult;
  1653.     unsigned long                saveA5;
  1654.     short                        reqCode;
  1655.     long                        reserved[2];
  1656.     AddrBlock                    serverHint;
  1657.     short                        dsRefNum;
  1658.     unsigned long                callID;
  1659.     AuthIdentity                identity;
  1660.     long                        gReserved1;
  1661.     long                        gReserved2;
  1662.     long                        gReserved3;
  1663.     long                        clientData;
  1664.     CreationID                    directoryRecordCID;
  1665. };
  1666. #if defined(powerc) || defined(__powerc)
  1667. #pragma options align=reset
  1668. #endif
  1669.  
  1670. typedef struct OCESetupRemoveDirectoryInfoPB OCESetupRemoveDirectoryInfoPB;
  1671.  
  1672. /*
  1673. kOCESetupGetDirectoryInfo:
  1674. Using this call info on an existing identity for a particular catalog under LocalIdentity umbrella
  1675. can be obtained.
  1676. For the specified catalog 'directoryName' and 'discriminator', rid and nativeName will
  1677. returned. Caller must provide appropriate buffer to get back rid and nativeName.
  1678. 'password' will be returned  for  non-ADAP Catalogs.
  1679. */
  1680.  
  1681. #if defined(powerc) || defined (__powerc)
  1682. #pragma options align=mac68k
  1683. #endif
  1684. struct OCESetupGetDirectoryInfoPB {
  1685.     Ptr                            qLink;
  1686.     long                        reserved1;
  1687.     long                        reserved2;
  1688.     AuthIOCompletionUPP            ioCompletion;
  1689.     OSErr                        ioResult;
  1690.     unsigned long                saveA5;
  1691.     short                        reqCode;
  1692.     long                        reserved[2];
  1693.     AddrBlock                    serverHint;
  1694.     short                        dsRefNum;
  1695.     unsigned long                callID;
  1696.     AuthIdentity                identity;
  1697.     long                        gReserved1;
  1698.     long                        gReserved2;
  1699.     long                        gReserved3;
  1700.     long                        clientData;
  1701.     DirectoryNamePtr            directoryName;
  1702.     DirDiscriminator            discriminator;
  1703.     RecordIDPtr                    recordID;
  1704.     RStringPtr                    nativeName;
  1705.     RStringPtr                    password;
  1706. };
  1707. #if defined(powerc) || defined(__powerc)
  1708. #pragma options align=reset
  1709. #endif
  1710.  
  1711. typedef struct OCESetupGetDirectoryInfoPB OCESetupGetDirectoryInfoPB;
  1712.  
  1713.  
  1714. /*****************************************************************************
  1715.  
  1716.  
  1717.          Catalog Manager operations
  1718.  
  1719.  
  1720. *****************************************************************************/
  1721.  
  1722. typedef union DirParamBlock DirParamBlock;
  1723. typedef DirParamBlock *DirParamBlockPtr;
  1724.  
  1725. /*
  1726.     DirIOCompletionProcs cannot be written in or called from a high-level 
  1727.     language without the help of mixed mode or assembly glue because they 
  1728.     use the following parameter-passing convention:
  1729.  
  1730.     typedef pascal void (*DirIOCompletionProcPtr)(DirParamBlockPtr paramBlock);
  1731.  
  1732.         In:
  1733.             =>     paramBlock                A0.L
  1734.         Out:
  1735.             none
  1736. */
  1737.  
  1738. enum  {
  1739.     uppDirIOCompletionProcInfo        = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
  1740. };
  1741.  
  1742. #if USESROUTINEDESCRIPTORS
  1743. typedef pascal void (*DirIOCompletionProcPtr)(DirParamBlockPtr paramBlock);
  1744.  
  1745. typedef UniversalProcPtr DirIOCompletionUPP;
  1746.  
  1747. #define CallDirIOCompletionProc(userRoutine, paramBlock)  \
  1748.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppDirIOCompletionProcInfo, (paramBlock))
  1749.  
  1750. #define NewDirIOCompletionProc(userRoutine)  \
  1751.     (DirIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
  1752.     uppDirIOCompletionProcInfo, GetCurrentISA())
  1753.  
  1754. #else
  1755. typedef ProcPtr DirIOCompletionUPP;
  1756.  
  1757. #define NewDirIOCompletionProc(userRoutine)  \
  1758.     (DirIOCompletionUPP)((userRoutine))
  1759.  
  1760. #endif
  1761.  
  1762.  
  1763. /* AddRecord */
  1764.  
  1765. #if defined(powerc) || defined (__powerc)
  1766. #pragma options align=mac68k
  1767. #endif
  1768. struct DirAddRecordPB {
  1769.     Ptr                            qLink;
  1770.     long                        reserved1;
  1771.     long                        reserved2;
  1772.     DirIOCompletionUPP            ioCompletion;
  1773.     OSErr                        ioResult;
  1774.     unsigned long                saveA5;
  1775.     short                        reqCode;
  1776.     long                        reserved[2];
  1777.     AddrBlock                    serverHint;
  1778.     short                        dsRefNum;
  1779.     unsigned long                callID;
  1780.     AuthIdentity                identity;
  1781.     long                        gReserved1;
  1782.     long                        gReserved2;
  1783.     long                        gReserved3;
  1784.     long                        clientData;
  1785.     RecordIDPtr                    aRecord;
  1786.     Boolean                        allowDuplicate;
  1787. };
  1788. #if defined(powerc) || defined(__powerc)
  1789. #pragma options align=reset
  1790. #endif
  1791.  
  1792. typedef struct DirAddRecordPB DirAddRecordPB;
  1793.  
  1794. /* DeleteRecord */
  1795.  
  1796. #if defined(powerc) || defined (__powerc)
  1797. #pragma options align=mac68k
  1798. #endif
  1799. struct DirDeleteRecordPB {
  1800.     Ptr                            qLink;
  1801.     long                        reserved1;
  1802.     long                        reserved2;
  1803.     DirIOCompletionUPP            ioCompletion;
  1804.     OSErr                        ioResult;
  1805.     unsigned long                saveA5;
  1806.     short                        reqCode;
  1807.     long                        reserved[2];
  1808.     AddrBlock                    serverHint;
  1809.     short                        dsRefNum;
  1810.     unsigned long                callID;
  1811.     AuthIdentity                identity;
  1812.     long                        gReserved1;
  1813.     long                        gReserved2;
  1814.     long                        gReserved3;
  1815.     long                        clientData;
  1816.     RecordIDPtr                    aRecord;
  1817. };
  1818. #if defined(powerc) || defined(__powerc)
  1819. #pragma options align=reset
  1820. #endif
  1821.  
  1822. typedef struct DirDeleteRecordPB DirDeleteRecordPB;
  1823.  
  1824. /* aRecord must contain valid PackedRLI and a CreationID. */
  1825.  
  1826.  
  1827.  
  1828. /**********************************************************************************/
  1829. /*
  1830. DirEnumerate:
  1831. This call can be used to enumerate both DNodes and records under a specified
  1832. DNode. A DNode is specified by the PackedRLIPtr 'aRLI'.
  1833.  
  1834. startingPoint indicates where to start the enumeration.  Initially,
  1835. it should be set to a value of nil.  After some records are enumerated,
  1836. the client can issue the call again with the same aRLI and recordName and
  1837. typeList. The last received DirEnumSpec in the startingPoint field.  The server
  1838. will continue the enumeration from that record on. if user wants to get back the
  1839. value specified in the startingRecord also, the Boolean 'includeStartingPoint'
  1840. must be set to 'true'. If this is set to 'false', records specified after the
  1841. startingPoint record will be returned.
  1842.  
  1843. sortBy indicates to the server to return the records that match in name-first
  1844. or type-first order.  sortDirection indicates to the server to search in forward
  1845. or backward sort order for RecordIDs Specified.
  1846.  
  1847. RecordIDS and Enumeration Criteria:
  1848.  
  1849. PackedRLIPtr parameter 'aRLI' will be accepted for DNode
  1850. specification.
  1851.  
  1852. One RStringPtr 'nameMatchString' is provided. User is allowed to
  1853. specify a wild card in the name. WildCard specification is specified in 
  1854. matchNameHow parameter and possible values are defined in DirMatchWith Enum.
  1855.  
  1856. 'typeCount' parameter indicate how many types are in the 'typeList'.
  1857.  
  1858. 'typeList' parmeter is a pointer to an RString array of size 'typeCount'.
  1859.  
  1860. If 'typeCount' is exactly equal to one, a wild card can be specified
  1861. for the entity type; otherwise types have to be completely specified.
  1862. WildCard specification is specified in  matchNameHow parameter
  1863.  and possible values are defined in DirMatchWith Enum.
  1864.  
  1865.  
  1866. A nil value for 'startingPoint' is allowed when sortDirection specified
  1867. is 'kSortBackwards'. This was not allowed previously.
  1868.  
  1869. 'enumFlags' parameter is a bit field. The following bits can be set:
  1870.     kEnumDistinguishedNameMask to get back records in the cluster data base.
  1871.     kEnumAliasMask to get back record aliases
  1872.     kEnumPseudonymMask to get back record pseudonyms
  1873.     kEnumDNodeMask to get back any children dNodes for the DNode specified in the
  1874.     'aRLI' parameter.
  1875.     kEnumForeignDNodeMask to get back any children dNodes which have ForeignDnodes in the
  1876.     dNode specified in the 'aRLI' parameter.
  1877.  
  1878.     kEnumAll is combination of all five values and can be used to enumerate
  1879.     everything under a specified DNode.
  1880.  
  1881.  
  1882.  
  1883. The results returned for each element will consist of a DirEnumSpec.
  1884. The DirEnumSpec contains 'enumFlag' which indicates the type of entity and a
  1885. union which will have either DNodeID or LocalRecordID depending on the value of 'enumFlag'.
  1886. The 'enumFlag'  will indicate whether the returned element is a
  1887. record(kEnumDistinguishedNameMask bit) or a alias(kEnumAliasMask bit) or a
  1888. Pseudonym(kEnumPseudonymMask) or a child DNode(kEnumDNodeMask bit).  If the 'enumFlag' value
  1889. is kEnumDnodeMask, it indicates the value returned in the union is a DNodeID (i.e. 'dNodeNumber'
  1890. is the 'dNodeNumber' of the child dnode(if the catalog supports dNodeNumbers, otherwise
  1891. this will be set to zero). The name will be the child dnode name. For other values of the
  1892. 'enumFlag', the value in the union will be LocalRecordID. In addition to kEnumDnodeMask it is
  1893. possible that kEnumForeignDNodeMask is also set. This is an advisory bit and application must make
  1894. it's own decision before displaying these records. If catalog supports kSupportIndexRatioMask, it
  1895. may also return the relative position of the record (percentile of total records) in the 
  1896. indexRatio field in EnumSpec.
  1897.  
  1898.  
  1899. responseSLRV will contain the script, language, region and version of the oce sorting software.
  1900. The results will be collected in the 'getBuffer' supplied by the user.
  1901. If buffer can not hold all the data returned 'kOCEMoreData' error will be returned.
  1902.  
  1903. If user receives 'noErr' or 'kOCEMoreData', buffer will contain valid results. A user
  1904. can extract the results in the 'getBuffer' by making DirEnumerateParse' call.
  1905. */
  1906.  
  1907.  
  1908. #if defined(powerc) || defined (__powerc)
  1909. #pragma options align=mac68k
  1910. #endif
  1911. struct DirEnumerateGetPB {
  1912.     Ptr                            qLink;
  1913.     long                        reserved1;
  1914.     long                        reserved2;
  1915.     DirIOCompletionUPP            ioCompletion;
  1916.     OSErr                        ioResult;
  1917.     unsigned long                saveA5;
  1918.     short                        reqCode;
  1919.     long                        reserved[2];
  1920.     AddrBlock                    serverHint;
  1921.     short                        dsRefNum;
  1922.     unsigned long                callID;
  1923.     AuthIdentity                identity;
  1924.     long                        gReserved1;
  1925.     long                        gReserved2;
  1926.     long                        gReserved3;
  1927.     long                        clientData;
  1928.     PackedRLIPtr                aRLI;                    /*  --> an RLI specifying the cluster to be enumerated */
  1929.     DirEnumSpec                    *startingPoint;            /*  --> */
  1930.     DirSortOption                sortBy;                    /*  --> */
  1931.     DirSortDirection            sortDirection;            /*  --> */
  1932.     long                        dReserved;                /*  --  */
  1933.     RStringPtr                    nameMatchString;        /*  --> name from which enumeration should start */
  1934.     RStringPtr                    *typesList;                /*  --> list of entity types to be enumerated */
  1935.     unsigned long                typeCount;                /*  --> number of types in the list */
  1936.     DirEnumChoices                enumFlags;                /*  --> indicates what to enumerate */
  1937.     Boolean                        includeStartingPoint;    /*  --> if true return the record specified in starting point */
  1938.     Byte                        padByte;
  1939.     DirMatchWith                matchNameHow;           /*  --> Matching Criteria for nameMatchString */
  1940.     DirMatchWith                matchTypeHow;           /*  --> Matching Criteria for typeList */
  1941.     Ptr                            getBuffer;                /*  --> */
  1942.     unsigned long                getBufferSize;            /*  --> */
  1943.     SLRV                        responseSLRV;            /*  <--  response SLRV */
  1944. };
  1945. #if defined(powerc) || defined(__powerc)
  1946. #pragma options align=reset
  1947. #endif
  1948.  
  1949. typedef struct DirEnumerateGetPB DirEnumerateGetPB;
  1950.  
  1951. /* The EnumerateRecords call-back function is defined as follows: */
  1952. typedef pascal Boolean (*ForEachDirEnumSpecProcPtr)(long clientData, const DirEnumSpec *enumSpec);
  1953.  
  1954. enum {
  1955.     uppForEachDirEnumSpecProcInfo = kPascalStackBased
  1956.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  1957.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  1958.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirEnumSpec*)))
  1959. };
  1960.  
  1961. #if USESROUTINEDESCRIPTORS
  1962. typedef UniversalProcPtr ForEachDirEnumSpecUPP;
  1963.  
  1964. #define CallForEachDirEnumSpecProc(userRoutine, clientData, enumSpec)        \
  1965.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDirEnumSpecProcInfo, (clientData), (enumSpec))
  1966. #define NewForEachDirEnumSpecProc(userRoutine)        \
  1967.         (ForEachDirEnumSpecUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDirEnumSpecProcInfo, GetCurrentISA())
  1968. #else
  1969. typedef ForEachDirEnumSpecProcPtr ForEachDirEnumSpecUPP;
  1970.  
  1971. #define CallForEachDirEnumSpecProc(userRoutine, clientData, enumSpec)        \
  1972.         (*(userRoutine))((clientData), (enumSpec))
  1973. #define NewForEachDirEnumSpecProc(userRoutine)        \
  1974.         (ForEachDirEnumSpecUPP)(userRoutine)
  1975. #endif
  1976.  
  1977. typedef ForEachDirEnumSpecUPP ForEachDirEnumSpec;
  1978.  
  1979. /*
  1980. EnumerateParse:
  1981. After an EnumerateGet call has completed, call EnumerateParse
  1982. to parse through the buffer that was filled in EnumerateGet.
  1983.  
  1984. 'eachEnumSpec' will be called each time to return to the client a
  1985. DirEnumSpec that matches the pattern for enumeration. 'enumFlag' indicates the type
  1986. of information returned in the DirEnumSpec
  1987. The clientData parameter that you pass in the parameter block will be passed
  1988. to 'forEachEnumDSSpecFunc'.  You are free to put anything in clientData - it is intended
  1989. to allow you some way to match the call-back to the original call (for
  1990. example, you make more then one aysynchronous EnumerateGet calls and you want to
  1991. associate returned results in some way).
  1992.  
  1993. The client should return FALSE from 'eachEnumSpec' to continue
  1994. processing of the EnumerateParse request.  Returning TRUE will
  1995. terminate the EnumerateParse request.
  1996.  
  1997. For synchronous calls, the call-back routine actually runs as part of the same thread
  1998. of execution as the thread that made the EnumerateParse call.  That means that the
  1999. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2000. that were in effect when the call was made.  Because of this, the call-back
  2001. routine has the same restrictions as the caller of EnumerateParse:
  2002. if EnumerateParse was not called from interrupt level, then the call-
  2003. back routine can allocate memory. For asynchronous calls, call-back routine is
  2004. like a ioCompletion except that A5 will be preserved for the application.
  2005. */
  2006.  
  2007. #if defined(powerc) || defined (__powerc)
  2008. #pragma options align=mac68k
  2009. #endif
  2010. struct DirEnumerateParsePB {
  2011.     Ptr                            qLink;
  2012.     long                        reserved1;
  2013.     long                        reserved2;
  2014.     DirIOCompletionUPP            ioCompletion;
  2015.     OSErr                        ioResult;
  2016.     unsigned long                saveA5;
  2017.     short                        reqCode;
  2018.     long                        reserved[2];
  2019.     AddrBlock                    serverHint;
  2020.     short                        dsRefNum;
  2021.     unsigned long                callID;
  2022.     AuthIdentity                identity;
  2023.     long                        gReserved1;
  2024.     long                        gReserved2;
  2025.     long                        gReserved3;
  2026.     long                        clientData;
  2027.     PackedRLIPtr                aRLI;
  2028.     long                        bReserved;
  2029.     long                        cReserved;
  2030.     ForEachDirEnumSpec            eachEnumSpec;
  2031.     long                        eReserved;
  2032.     long                        fReserved;
  2033.     long                        gReserved;
  2034.     long                        hReserved;
  2035.     long                        iReserved;
  2036.     Ptr                            getBuffer;
  2037.     unsigned long                getBufferSize;
  2038.     short                        l1Reserved;
  2039.     short                        l2Reserved;
  2040.     short                        l3Reserved;
  2041.     short                        l4Reserved;
  2042. };
  2043. #if defined(powerc) || defined(__powerc)
  2044. #pragma options align=reset
  2045. #endif
  2046.  
  2047. typedef struct DirEnumerateParsePB DirEnumerateParsePB;
  2048.  
  2049. /*
  2050.  * FindRecordGet operates similarly to DirEnumerate except it returns a list
  2051.  * of records instead of records local to a cluster.
  2052. */
  2053. #if defined(powerc) || defined (__powerc)
  2054. #pragma options align=mac68k
  2055. #endif
  2056. struct DirFindRecordGetPB {
  2057.     Ptr                            qLink;
  2058.     long                        reserved1;
  2059.     long                        reserved2;
  2060.     DirIOCompletionUPP            ioCompletion;
  2061.     OSErr                        ioResult;
  2062.     unsigned long                saveA5;
  2063.     short                        reqCode;
  2064.     long                        reserved[2];
  2065.     AddrBlock                    serverHint;
  2066.     short                        dsRefNum;
  2067.     unsigned long                callID;
  2068.     AuthIdentity                identity;
  2069.     long                        gReserved1;
  2070.     long                        gReserved2;
  2071.     long                        gReserved3;
  2072.     long                        clientData;
  2073.     RecordIDPtr                    startingPoint;
  2074.     long                        reservedA[2];
  2075.     RStringPtr                    nameMatchString;
  2076.     RStringPtr                    *typesList;
  2077.     unsigned long                typeCount;
  2078.     long                        reservedB;
  2079.     short                        reservedC;
  2080.     DirMatchWith                matchNameHow;
  2081.     DirMatchWith                matchTypeHow;
  2082.     Ptr                            getBuffer;
  2083.     unsigned long                getBufferSize;
  2084.     DirectoryNamePtr            directoryName;
  2085.     DirDiscriminator            discriminator;
  2086. };
  2087. #if defined(powerc) || defined(__powerc)
  2088. #pragma options align=reset
  2089. #endif
  2090.  
  2091. typedef struct DirFindRecordGetPB DirFindRecordGetPB;
  2092.  
  2093. /* The FindRecordParse call-back function is defined as follows: */
  2094. typedef pascal Boolean (*ForEachRecordProcPtr)(long clientData, const DirEnumSpec *enumSpec, PackedRLIPtr pRLI);
  2095.  
  2096. enum {
  2097.     uppForEachRecordProcInfo = kPascalStackBased
  2098.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  2099.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  2100.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirEnumSpec*)))
  2101.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(PackedRLIPtr)))
  2102. };
  2103.  
  2104. #if USESROUTINEDESCRIPTORS
  2105. typedef UniversalProcPtr ForEachRecordUPP;
  2106.  
  2107. #define CallForEachRecordProc(userRoutine, clientData, enumSpec, pRLI)        \
  2108.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordProcInfo, (clientData), (enumSpec), (pRLI))
  2109. #define NewForEachRecordProc(userRoutine)        \
  2110.         (ForEachRecordUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordProcInfo, GetCurrentISA())
  2111. #else
  2112. typedef ForEachRecordProcPtr ForEachRecordUPP;
  2113.  
  2114. #define CallForEachRecordProc(userRoutine, clientData, enumSpec, pRLI)        \
  2115.         (*(userRoutine))((clientData), (enumSpec), (pRLI))
  2116. #define NewForEachRecordProc(userRoutine)        \
  2117.         (ForEachRecordUPP)(userRoutine)
  2118. #endif
  2119.  
  2120. typedef ForEachRecordUPP ForEachRecord;
  2121.  
  2122. /*
  2123.  * This PB same as DirFindRecordGet except it includes the callback function
  2124. */
  2125. #if defined(powerc) || defined (__powerc)
  2126. #pragma options align=mac68k
  2127. #endif
  2128. struct DirFindRecordParsePB {
  2129.     Ptr                            qLink;
  2130.     long                        reserved1;
  2131.     long                        reserved2;
  2132.     DirIOCompletionUPP            ioCompletion;
  2133.     OSErr                        ioResult;
  2134.     unsigned long                saveA5;
  2135.     short                        reqCode;
  2136.     long                        reserved[2];
  2137.     AddrBlock                    serverHint;
  2138.     short                        dsRefNum;
  2139.     unsigned long                callID;
  2140.     AuthIdentity                identity;
  2141.     long                        gReserved1;
  2142.     long                        gReserved2;
  2143.     long                        gReserved3;
  2144.     long                        clientData;
  2145.     RecordIDPtr                    startingPoint;
  2146.     long                        reservedA[2];
  2147.     RStringPtr                    nameMatchString;
  2148.     RStringPtr                    *typesList;
  2149.     unsigned long                typeCount;
  2150.     long                        reservedB;
  2151.     short                        reservedC;
  2152.     DirMatchWith                matchNameHow;
  2153.     DirMatchWith                matchTypeHow;
  2154.     Ptr                            getBuffer;
  2155.     unsigned long                getBufferSize;
  2156.     DirectoryNamePtr            directoryName;
  2157.     DirDiscriminator            discriminator;
  2158.     ForEachRecord                forEachRecordFunc;
  2159. };
  2160. #if defined(powerc) || defined(__powerc)
  2161. #pragma options align=reset
  2162. #endif
  2163.  
  2164. typedef struct DirFindRecordParsePB DirFindRecordParsePB;
  2165.  
  2166. /*
  2167. LookupGet:
  2168.  
  2169. aRecordList is an array of pointers to RecordIDs, each of which must
  2170. contain valid PackedRLI and a CreationID.  recordIDCount is
  2171. the size of this array.
  2172.  
  2173. attrTypeList is an array of pointers to AttributeTypes.  attrTypeCount is
  2174. the size of this array.
  2175.  
  2176. staringRecordIndex is the record from which to continue the lookup.
  2177. If you want to start from first record in the list, this must be 1 (not zero).
  2178. This value must always be <= recordIDCount.
  2179.  
  2180. startingAttributeIndex is the AttributeType from which we want to continue the lookup.
  2181. If you want to start from first attribute in the list, this must be 1 (not zero).
  2182. This value must always be <= attrTypeCount.
  2183.  
  2184. startingAttribute is the value of the attribute value from which we want to
  2185. continue lookup. In case of catalogs supporting creationIDs, startingAttribute
  2186. may contain only a CID. Other catalogs may require the entire value.
  2187. If a non-null cid is given and if an attribute value with that cid is not found, this
  2188. call will terminate with kOCENoSuchAttribute error. A client should not make a LookupParse call
  2189. after getting this error.
  2190.  
  2191. 'includeStartingPoint' boolean can be set to 'true' to receive the value specified in the
  2192. startingPoint in the results returned. If this is set to 'false', the value
  2193. specified in the startingAttribute will not be returned.
  2194.  
  2195. When LookupGet call fails with kOCEMoreData, the client will be able to find out where the call ended
  2196. with a subsequent LookupParse call. When the LookupParse call completes with kOCEMoreData,
  2197. lastRecordIndex, lastAttributeIndex and lastValueCID will point to the corresponding
  2198. recordID, attributeType and the CreationID of the last value returned successfully. These parameters
  2199. are exactly the same ones for the startingRecordIndex, startingAttributeIndex, and startingAttrValueCID
  2200. so they can be used in a subsequent LookupGet call to continue the lookup.
  2201.  
  2202. In an extreme case, It is possible that we had an attribute value that is too large to fit
  2203. in the client's buffer. In such cases, if it was the only thing that we tried to fit
  2204. into the buffer, the client will not able to proceed further because he will not know the
  2205. attributeCID of the attribute to continue with.  Also he does not know how big a buffer
  2206. would be needed for the next call to get this 'mondo' attribute value successfully.
  2207.  
  2208. to support this, LookupParse call will do the following:
  2209.  
  2210. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  2211. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  2212. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  2213. However, if it was not even called once, then the attribute value may be too big to fit in the
  2214. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  2215. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  2216. ForEachAttributeValue was not called because the user does not have read access to some of
  2217. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  2218. any of the attribute values.  A kOCEMoreData error is returned.
  2219.  
  2220. The Toolbox will check for duplicate RecordIDs in the aRecordList. If found, it will return
  2221. 'daDuplicateRecordIDErr'.
  2222.  
  2223. The Toolbox will check for duplicate AttributeTypes in the attrTypeList. If found it will
  2224. return 'daDuplicateAttrTypeErr'.
  2225. */
  2226.  
  2227. #if defined(powerc) || defined (__powerc)
  2228. #pragma options align=mac68k
  2229. #endif
  2230. struct DirLookupGetPB {
  2231.     Ptr                            qLink;
  2232.     long                        reserved1;
  2233.     long                        reserved2;
  2234.     DirIOCompletionUPP            ioCompletion;
  2235.     OSErr                        ioResult;
  2236.     unsigned long                saveA5;
  2237.     short                        reqCode;
  2238.     long                        reserved[2];
  2239.     AddrBlock                    serverHint;
  2240.     short                        dsRefNum;
  2241.     unsigned long                callID;
  2242.     AuthIdentity                identity;
  2243.     long                        gReserved1;
  2244.     long                        gReserved2;
  2245.     long                        gReserved3;
  2246.     long                        clientData;
  2247.     RecordIDPtr                    *aRecordList;            /*  --> an array of RecordID pointers */
  2248.     AttributeTypePtr            *attrTypeList;            /*  --> an array of attribute types */
  2249.     long                        cReserved;                /*  --  */
  2250.     long                        dReserved;                /*  --  */
  2251.     long                        eReserved;                /*  --  */
  2252.     long                        fReserved;                /*  --  */
  2253.     unsigned long                recordIDCount;            /*  --> */
  2254.     unsigned long                attrTypeCount;            /*  --> */
  2255.     Boolean                        includeStartingPoint;    /*  --> if true return the value specified by the starting indices */
  2256.     Byte                        padByte;
  2257.     short                        i1Reserved;                /*  --  */
  2258.     Ptr                            getBuffer;                /*  --> */
  2259.     unsigned long                getBufferSize;            /*  --> */
  2260.     unsigned long                startingRecordIndex;    /*  --> start from this record */
  2261.     unsigned long                startingAttrTypeIndex;    /*  --> start from this attribute type */
  2262.     Attribute                    startingAttribute;        /*  --> start from this attribute value */
  2263.     long                        pReserved;                /*  --  */
  2264. };
  2265. #if defined(powerc) || defined(__powerc)
  2266. #pragma options align=reset
  2267. #endif
  2268.  
  2269. typedef struct DirLookupGetPB DirLookupGetPB;
  2270.  
  2271. /* The Lookup call-back functions are defined as follows: */
  2272. typedef pascal Boolean (*ForEachLookupRecordIDProcPtr)(long clientData, const RecordID *recordID);
  2273.  
  2274. enum {
  2275.     uppForEachLookupRecordIDProcInfo = kPascalStackBased
  2276.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  2277.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  2278.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RecordID*)))
  2279. };
  2280.  
  2281. #if USESROUTINEDESCRIPTORS
  2282. typedef UniversalProcPtr ForEachLookupRecordIDUPP;
  2283.  
  2284. #define CallForEachLookupRecordIDProc(userRoutine, clientData, recordID)        \
  2285.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachLookupRecordIDProcInfo, (clientData), (recordID))
  2286. #define NewForEachLookupRecordIDProc(userRoutine)        \
  2287.         (ForEachLookupRecordIDUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachLookupRecordIDProcInfo, GetCurrentISA())
  2288. #else
  2289. typedef ForEachLookupRecordIDProcPtr ForEachLookupRecordIDUPP;
  2290.  
  2291. #define CallForEachLookupRecordIDProc(userRoutine, clientData, recordID)        \
  2292.         (*(userRoutine))((clientData), (recordID))
  2293. #define NewForEachLookupRecordIDProc(userRoutine)        \
  2294.         (ForEachLookupRecordIDUPP)(userRoutine)
  2295. #endif
  2296.  
  2297. typedef ForEachLookupRecordIDUPP ForEachLookupRecordID;
  2298.  
  2299. typedef pascal Boolean (*ForEachAttrTypeLookupProcPtr)(long clientData, const AttributeType *attrType, AccessMask myAttrAccMask);
  2300.  
  2301. enum {
  2302.     uppForEachAttrTypeLookupProcInfo = kPascalStackBased
  2303.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  2304.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  2305.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AttributeType*)))
  2306.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  2307. };
  2308.  
  2309. #if USESROUTINEDESCRIPTORS
  2310. typedef UniversalProcPtr ForEachAttrTypeLookupUPP;
  2311.  
  2312. #define CallForEachAttrTypeLookupProc(userRoutine, clientData, attrType, myAttrAccMask)        \
  2313.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrTypeLookupProcInfo, (clientData), (attrType), (myAttrAccMask))
  2314. #define NewForEachAttrTypeLookupProc(userRoutine)        \
  2315.         (ForEachAttrTypeLookupUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrTypeLookupProcInfo, GetCurrentISA())
  2316. #else
  2317. typedef ForEachAttrTypeLookupProcPtr ForEachAttrTypeLookupUPP;
  2318.  
  2319. #define CallForEachAttrTypeLookupProc(userRoutine, clientData, attrType, myAttrAccMask)        \
  2320.         (*(userRoutine))((clientData), (attrType), (myAttrAccMask))
  2321. #define NewForEachAttrTypeLookupProc(userRoutine)        \
  2322.         (ForEachAttrTypeLookupUPP)(userRoutine)
  2323. #endif
  2324.  
  2325. typedef ForEachAttrTypeLookupUPP ForEachAttrTypeLookup;
  2326.  
  2327. typedef pascal Boolean (*ForEachAttrValueProcPtr)(long clientData, const Attribute *attribute);
  2328.  
  2329. enum {
  2330.     uppForEachAttrValueProcInfo = kPascalStackBased
  2331.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  2332.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  2333.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Attribute*)))
  2334. };
  2335.  
  2336. #if USESROUTINEDESCRIPTORS
  2337. typedef UniversalProcPtr ForEachAttrValueUPP;
  2338.  
  2339. #define CallForEachAttrValueProc(userRoutine, clientData, attribute)        \
  2340.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrValueProcInfo, (clientData), (attribute))
  2341. #define NewForEachAttrValueProc(userRoutine)        \
  2342.         (ForEachAttrValueUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrValueProcInfo, GetCurrentISA())
  2343. #else
  2344. typedef ForEachAttrValueProcPtr ForEachAttrValueUPP;
  2345.  
  2346. #define CallForEachAttrValueProc(userRoutine, clientData, attribute)        \
  2347.         (*(userRoutine))((clientData), (attribute))
  2348. #define NewForEachAttrValueProc(userRoutine)        \
  2349.         (ForEachAttrValueUPP)(userRoutine)
  2350. #endif
  2351.  
  2352. typedef ForEachAttrValueUPP ForEachAttrValue;
  2353.  
  2354. /*
  2355. LookupParse:
  2356.  
  2357. After a LookupGet call has completed, call LookupParse
  2358. to parse through the buffer that was filled in LookupGet.  The
  2359. toolbox will parse through the buffer and call the appropriate call-back routines
  2360. for each item in the getBuffer.
  2361.  
  2362. 'eachRecordID' will be called each time to return to the client one of the
  2363. RecordIDs from aRecordList.  The clientData parameter that you
  2364. pass in the parameter block will be passed to eachRecordID.
  2365. You are free to put anything in clientData - it is intended to allow
  2366. you some way to match the call-back to the original call (in case, for
  2367. example, you make simultaneous asynchronous LookupGet calls).  If you don't
  2368. want to get a call-back for each RecordID (for example, if you're looking up
  2369. attributes for only one RecordID), pass nil for eachRecordID.
  2370.  
  2371. After forEachLocalRecordIDFunc is called, eachAttrType may be called to pass an
  2372. attribute type (one from attrTypeList) that exists in the record specified
  2373. in the last eachRecordID call.  If you don't want to get a call-back for
  2374. each AttributeType (for example, if you're looking up only one attribute type,
  2375. or you prefer to read the type from the Attribute struct during the eachAttrValue
  2376. call-back routine), pass nil for eachAttrType. However access controls may
  2377. prohibit you from reading some attribute types; in that case eachAttrValue
  2378. may not be called even though the value exists. Hence the client should
  2379. supply this call-back function to see the access controls for each attribute type.
  2380.  
  2381. This will be followed by one or more calls to eachAttrValue, to pass the
  2382. type, tag, and attribute value.  NOTE THIS CHANGE:  you are no longer expected to
  2383. pass a pointer to a buffer in which to put the value.  Now you get a pointer to
  2384. the value, and you can process it within the call-back routine.
  2385. After one or more values are returned, eachAttrType may be called again to pass
  2386. another attribute type that exists in the last-specified RecordID.
  2387.  
  2388. The client should return FALSE from eachRecordID, eachAttrType, and
  2389. eachAttrValue to continue processing of the LookupParse request.  Returning TRUE
  2390. from any call-back will terminate the LookupParse request.
  2391.  
  2392. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  2393. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  2394. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  2395. However, if it was not even called once, then the attribute value may be too big to fit in the
  2396. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  2397. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  2398. ForEachAttributeValue was not called because the user does not have read access to some of
  2399. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  2400. any of the attribute values.  A kOCEMoreData error is returned.
  2401.  
  2402. For synchronous calls, the call-back routine actually runs as part of the same thread
  2403. of execution as the thread that made the LookupParse call.  That means that the
  2404. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2405. that were in effect when the call was made.  Because of this, the call-back
  2406. routine has the same restrictions as the caller of LookupParse:
  2407. if LookupParse was not called from interrupt level, then the call-
  2408. back routine can allocate memory. For asynchronous calls, call-back routine is
  2409. like a ioCompletion except that A5 will be preserved for the application.
  2410. */
  2411.  
  2412. #if defined(powerc) || defined (__powerc)
  2413. #pragma options align=mac68k
  2414. #endif
  2415. struct DirLookupParsePB {
  2416.     Ptr                            qLink;
  2417.     long                        reserved1;
  2418.     long                        reserved2;
  2419.     DirIOCompletionUPP            ioCompletion;
  2420.     OSErr                        ioResult;
  2421.     unsigned long                saveA5;
  2422.     short                        reqCode;
  2423.     long                        reserved[2];
  2424.     AddrBlock                    serverHint;
  2425.     short                        dsRefNum;
  2426.     unsigned long                callID;
  2427.     AuthIdentity                identity;
  2428.     long                        gReserved1;
  2429.     long                        gReserved2;
  2430.     long                        gReserved3;
  2431.     long                        clientData;
  2432.     RecordIDPtr                 *aRecordList;            /*  --> must be same from the corresponding Get call */
  2433.     AttributeTypePtr             *attrTypeList;            /*  --> must be same from the corresponding Get call */
  2434.     long                        cReserved;                /*  --  */
  2435.     ForEachLookupRecordID        eachRecordID;            /*  --> */
  2436.     ForEachAttrTypeLookup        eachAttrType;            /*  --> */
  2437.     ForEachAttrValue            eachAttrValue;            /*  --> */
  2438.     unsigned long                recordIDCount;            /*  --> must be same from the corresponding Get call */
  2439.     unsigned long                attrTypeCount;            /*  --> must be same from the corresponding Get call */
  2440.     long                        iReserved;                /*  --  */
  2441.     Ptr                            getBuffer;                /*  --> must be same from the corresponding Get call*/
  2442.     unsigned long                getBufferSize;            /*  --> must be same from the corresponding Get call*/
  2443.     unsigned long                lastRecordIndex;        /* <--  last RecordID processed when parse completed */
  2444.     unsigned long                lastAttributeIndex;        /* <--  last Attribute Type processed when parse completed */
  2445.     Attribute                    lastAttribute;            /* <--  last attribute value (with this CreationID) processed when parse completed */
  2446.     unsigned long                attrSize;                /* <--  length of the attribute we did not return */
  2447. };
  2448. #if defined(powerc) || defined(__powerc)
  2449. #pragma options align=reset
  2450. #endif
  2451.  
  2452. typedef struct DirLookupParsePB DirLookupParsePB;
  2453.  
  2454. /* AddAttributeValue */
  2455.  
  2456. #if defined(powerc) || defined (__powerc)
  2457. #pragma options align=mac68k
  2458. #endif
  2459. struct DirAddAttributeValuePB {
  2460.     Ptr                            qLink;
  2461.     long                        reserved1;
  2462.     long                        reserved2;
  2463.     DirIOCompletionUPP        ioCompletion;
  2464.     OSErr                        ioResult;
  2465.     unsigned long                saveA5;
  2466.     short                        reqCode;
  2467.     long                        reserved[2];
  2468.     AddrBlock                    serverHint;
  2469.     short                        dsRefNum;
  2470.     unsigned long                callID;
  2471.     AuthIdentity                identity;
  2472.     long                        gReserved1;
  2473.     long                        gReserved2;
  2474.     long                        gReserved3;
  2475.     long                        clientData;
  2476.     RecordIDPtr                    aRecord;
  2477.     AttributePtr                attr;
  2478. };
  2479. #if defined(powerc) || defined(__powerc)
  2480. #pragma options align=reset
  2481. #endif
  2482.  
  2483. typedef struct DirAddAttributeValuePB DirAddAttributeValuePB;
  2484.  
  2485. /*
  2486. aRecord must contain valid PackedRLI and a CreationID.
  2487.  
  2488. Instead of passing type, length, and value in three separate
  2489. fields, we take a pointer to an Attribute structure that contains
  2490. all three, and has room for the AttributeCreationNumber.
  2491. The AttributeCreationID will be returned in the attr itself.
  2492.  
  2493. The AttributeTag tells the catalog service that the attribute is an RString,
  2494. binary, or a RecordID.
  2495. */
  2496.  
  2497. /*
  2498. DeleteAttributeType:
  2499. This call is provided so that an existing AttributeType can be deleted.
  2500. If any attribute values exist for this type, they will all be deleted
  2501. (if the user has access rights to delete the values) and then the attribute type
  2502. will be deleted. Otherwise dsAccessDenied error will be returned.
  2503. */
  2504.  
  2505. #if defined(powerc) || defined (__powerc)
  2506. #pragma options align=mac68k
  2507. #endif
  2508. struct DirDeleteAttributeTypePB {
  2509.     Ptr                            qLink;
  2510.     long                        reserved1;
  2511.     long                        reserved2;
  2512.     DirIOCompletionUPP            ioCompletion;
  2513.     OSErr                        ioResult;
  2514.     unsigned long                saveA5;
  2515.     short                        reqCode;
  2516.     long                        reserved[2];
  2517.     AddrBlock                    serverHint;
  2518.     short                        dsRefNum;
  2519.     unsigned long                callID;
  2520.     AuthIdentity                identity;
  2521.     long                        gReserved1;
  2522.     long                        gReserved2;
  2523.     long                        gReserved3;
  2524.     long                        clientData;
  2525.     RecordIDPtr                    aRecord;
  2526.     AttributeTypePtr            attrType;
  2527. };
  2528. #if defined(powerc) || defined(__powerc)
  2529. #pragma options align=reset
  2530. #endif
  2531.  
  2532. typedef struct DirDeleteAttributeTypePB DirDeleteAttributeTypePB;
  2533.  
  2534. /*
  2535.     DeleteAttributeValue
  2536. */
  2537. #if defined(powerc) || defined (__powerc)
  2538. #pragma options align=mac68k
  2539. #endif
  2540. struct DirDeleteAttributeValuePB {
  2541.     Ptr                            qLink;
  2542.     long                        reserved1;
  2543.     long                        reserved2;
  2544.     DirIOCompletionUPP            ioCompletion;
  2545.     OSErr                        ioResult;
  2546.     unsigned long                saveA5;
  2547.     short                        reqCode;
  2548.     long                        reserved[2];
  2549.     AddrBlock                    serverHint;
  2550.     short                        dsRefNum;
  2551.     unsigned long                callID;
  2552.     AuthIdentity                identity;
  2553.     long                        gReserved1;
  2554.     long                        gReserved2;
  2555.     long                        gReserved3;
  2556.     long                        clientData;
  2557.     RecordIDPtr                    aRecord;
  2558.     AttributePtr                attr;
  2559. };
  2560. #if defined(powerc) || defined(__powerc)
  2561. #pragma options align=reset
  2562. #endif
  2563.  
  2564. typedef struct DirDeleteAttributeValuePB DirDeleteAttributeValuePB;
  2565.  
  2566. /*
  2567.     ChangeAttributeValue:
  2568.     currentAttr ==> the attribute to be changed. For ADAS and PAB CreationID is
  2569.                     sufficient
  2570.     newAttr     ==> new value for the attribute. For ADAS and PAB 
  2571.                     CreationID field will be set when
  2572.                     the call succeesfully completes
  2573.     
  2574.     aRecord     ==> must contain valid PackedRecordLocationInfo and a CreationID.
  2575.  
  2576.  
  2577.     
  2578. */
  2579.  
  2580. #if defined(powerc) || defined (__powerc)
  2581. #pragma options align=mac68k
  2582. #endif
  2583. struct DirChangeAttributeValuePB {
  2584.     Ptr                            qLink;
  2585.     long                        reserved1;
  2586.     long                        reserved2;
  2587.     DirIOCompletionUPP            ioCompletion;
  2588.     OSErr                        ioResult;
  2589.     unsigned long                saveA5;
  2590.     short                        reqCode;
  2591.     long                        reserved[2];
  2592.     AddrBlock                    serverHint;
  2593.     short                        dsRefNum;
  2594.     unsigned long                callID;
  2595.     AuthIdentity                identity;
  2596.     long                        gReserved1;
  2597.     long                        gReserved2;
  2598.     long                        gReserved3;
  2599.     long                        clientData;
  2600.     RecordIDPtr                    aRecord;
  2601.     AttributePtr                currentAttr;
  2602.     AttributePtr                newAttr;
  2603. };
  2604. #if defined(powerc) || defined(__powerc)
  2605. #pragma options align=reset
  2606. #endif
  2607.  
  2608. typedef struct DirChangeAttributeValuePB DirChangeAttributeValuePB;
  2609.  
  2610. /* VerifyAttributeValue */
  2611.  
  2612. #if defined(powerc) || defined (__powerc)
  2613. #pragma options align=mac68k
  2614. #endif
  2615. struct DirVerifyAttributeValuePB {
  2616.     Ptr                            qLink;
  2617.     long                        reserved1;
  2618.     long                        reserved2;
  2619.     DirIOCompletionUPP            ioCompletion;
  2620.     OSErr                        ioResult;
  2621.     unsigned long                saveA5;
  2622.     short                        reqCode;
  2623.     long                        reserved[2];
  2624.     AddrBlock                    serverHint;
  2625.     short                        dsRefNum;
  2626.     unsigned long                callID;
  2627.     AuthIdentity                identity;
  2628.     long                        gReserved1;
  2629.     long                        gReserved2;
  2630.     long                        gReserved3;
  2631.     long                        clientData;
  2632.     RecordIDPtr                    aRecord;
  2633.     AttributePtr                attr;
  2634. };
  2635. #if defined(powerc) || defined(__powerc)
  2636. #pragma options align=reset
  2637. #endif
  2638.  
  2639. typedef struct DirVerifyAttributeValuePB DirVerifyAttributeValuePB;
  2640.  
  2641. /*
  2642. aRecord must contain valid PackedRLI and a CreationID.
  2643.  
  2644. The attribute type and value are passed in the attribute structure.  If the
  2645. attribute CreationID is non-zero, the server will verify that an attribute with
  2646. the specified value and creation number exists in aRecord.  If the attribute
  2647. CreationID is zero, the server will verify the attribute by type and value
  2648. alone, and return the attribute CreationID in the Attribute struct if the
  2649. attribute exists.
  2650. */
  2651.  
  2652.  
  2653. /*
  2654. EnumerateAttributeTypesGet:
  2655. The following two calls can be used to enumerate the attribute types present in
  2656. a specified RecordID.  The first, EnumerateAttributeTypesGet, processes the request
  2657. and reads the response into getBuffer, as much as will fit.  A kOCEMoreData error will
  2658. be returned if the buffer was not large enough.  After this call completes, the
  2659. client can call EnumerateAttributeTypesParse (see below).
  2660.  
  2661. The user will able to continue from a startingPoint by setting a startingAttrType.
  2662. Typically, this should be the last value returned in EnumerateAttributeTypesParse call
  2663. when 'kOCEMoreData' is returned.
  2664.  
  2665. If 'includeStartingPoint' is true when a 'startingAttrType' is specified, the starting value
  2666. will be included in the results, if it exists. If this is set to false, this value will not
  2667. be included. AttributeTypes following this type will be returned.
  2668. */
  2669.  
  2670. #if defined(powerc) || defined (__powerc)
  2671. #pragma options align=mac68k
  2672. #endif
  2673. struct DirEnumerateAttributeTypesGetPB {
  2674.     Ptr                            qLink;
  2675.     long                        reserved1;
  2676.     long                        reserved2;
  2677.     DirIOCompletionUPP            ioCompletion;
  2678.     OSErr                        ioResult;
  2679.     unsigned long                saveA5;
  2680.     short                        reqCode;
  2681.     long                        reserved[2];
  2682.     AddrBlock                    serverHint;
  2683.     short                        dsRefNum;
  2684.     unsigned long                callID;
  2685.     AuthIdentity                identity;
  2686.     long                        gReserved1;
  2687.     long                        gReserved2;
  2688.     long                        gReserved3;
  2689.     long                        clientData;
  2690.     RecordIDPtr                    aRecord;
  2691.     AttributeTypePtr            startingAttrType;
  2692.     long                        cReserved;
  2693.     long                        dReserved;
  2694.     long                        eReserved;
  2695.     long                        fReserved;
  2696.     long                        gReserved;
  2697.     long                        hReserved;
  2698.     Boolean                        includeStartingPoint;    /*  --> if true return the attrType specified by starting point */
  2699.     Byte                        padByte;
  2700.     short                        i1Reserved;
  2701.     Ptr                            getBuffer;
  2702.     unsigned long                getBufferSize;
  2703. };
  2704. #if defined(powerc) || defined(__powerc)
  2705. #pragma options align=reset
  2706. #endif
  2707.  
  2708. typedef struct DirEnumerateAttributeTypesGetPB DirEnumerateAttributeTypesGetPB;
  2709.  
  2710. /* The call-back function is defined as follows: */
  2711. typedef pascal Boolean (*ForEachAttrTypeProcPtr)(long clientData, const AttributeType *attrType);
  2712.  
  2713. enum {
  2714.     uppForEachAttrTypeProcInfo = kPascalStackBased
  2715.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  2716.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  2717.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AttributeType*)))
  2718. };
  2719.  
  2720. #if USESROUTINEDESCRIPTORS
  2721. typedef UniversalProcPtr ForEachAttrTypeUPP;
  2722.  
  2723. #define CallForEachAttrTypeProc(userRoutine, clientData, attrType)        \
  2724.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttrTypeProcInfo, (clientData), (attrType))
  2725. #define NewForEachAttrTypeProc(userRoutine)        \
  2726.         (ForEachAttrTypeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttrTypeProcInfo, GetCurrentISA())
  2727. #else
  2728. typedef ForEachAttrTypeProcPtr ForEachAttrTypeUPP;
  2729.  
  2730. #define CallForEachAttrTypeProc(userRoutine, clientData, attrType)        \
  2731.         (*(userRoutine))((clientData), (attrType))
  2732. #define NewForEachAttrTypeProc(userRoutine)        \
  2733.         (ForEachAttrTypeUPP)(userRoutine)
  2734. #endif
  2735.  
  2736. typedef ForEachAttrTypeUPP ForEachAttrType;
  2737.  
  2738. /*
  2739. EnumerateAttributeTypesParse:
  2740. After an EnumerateAttributeTypesGet call has completed, call EnumerateAttributeTypesParse
  2741. to parse through the buffer that was filled in EnumerateAttributeTypesGet.  The
  2742. toolbox will parse through the buffer and call the call-back routine for
  2743. each attribute type in the getBuffer.
  2744.  
  2745. The client should return false from eachAttrType to continue
  2746. processing of the EnumerateAttributeTypesParse request.  Returning true will
  2747. terminate the EnumerateAttributeTypesParse request.  The clientData parameter that
  2748. you pass in the parameter block will be passed to eachAttrType.
  2749. You are free to put anything in clientData - it is intended to allow
  2750. you some way to match the call-back to the original call (in case, for
  2751. example, you make simultaneous asynchronous calls).
  2752.  
  2753. For synchronous calls, the call-back routine actually runs as part of the same thread
  2754. of execution as the thread that made the EnumerateAttributeTypesParse call.  That means that the
  2755. same low-memory globals, A5, stack, etc. are in effect during the call-back
  2756. that were in effect when the call was made.  Because of this, the call-back
  2757. routine has the same restrictions as the caller of EnumerateAttributeTypesParse.
  2758. If EnumerateAttributeTypesParse was not called from interrupt level, then the call-
  2759. back routine can allocate memory. For asynchronous calls, call-back routine is
  2760. like a ioCompletion except that A5 will be preserved for the application.
  2761. */
  2762.  
  2763. #if defined(powerc) || defined (__powerc)
  2764. #pragma options align=mac68k
  2765. #endif
  2766. struct DirEnumerateAttributeTypesParsePB {
  2767.     Ptr                            qLink;
  2768.     long                        reserved1;
  2769.     long                        reserved2;
  2770.     DirIOCompletionUPP            ioCompletion;
  2771.     OSErr                        ioResult;
  2772.     unsigned long                saveA5;
  2773.     short                        reqCode;
  2774.     long                        reserved[2];
  2775.     AddrBlock                    serverHint;
  2776.     short                        dsRefNum;
  2777.     unsigned long                callID;
  2778.     AuthIdentity                identity;
  2779.     long                        gReserved1;
  2780.     long                        gReserved2;
  2781.     long                        gReserved3;
  2782.     long                        clientData;
  2783.     RecordIDPtr                    aRecord;        /*  --> Same as DirEnumerateAttributeTypesGetPB */
  2784.     long                        bReserved;
  2785.     long                        cReserved;
  2786.     long                        dReserved;
  2787.     ForEachAttrType                eachAttrType;
  2788.     long                        fReserved;
  2789.     long                        gReserved;
  2790.     long                        hReserved;
  2791.     long                        iReserved;
  2792.     Ptr                            getBuffer;
  2793.     unsigned long                getBufferSize;
  2794. };
  2795. #if defined(powerc) || defined(__powerc)
  2796. #pragma options align=reset
  2797. #endif
  2798.  
  2799. typedef struct DirEnumerateAttributeTypesParsePB DirEnumerateAttributeTypesParsePB;
  2800.  
  2801. /*
  2802. DirAbort:
  2803. With this call a user will able to abort an outstanding catalog service call.
  2804. A user must pass a pointer to the parameter block for the outstanding call.
  2805. In the current version of the product, the toolbox will process this call
  2806. for NetSearchADAPDirectoriesGet or FindADAPDirectoryByNetSearch calls and if possible
  2807. it will abort. For other calls for ADAP and PAB this will return 'daAbortFailErr'.
  2808. For CSAM catalogs, this call will be passed to the corresponding CSAM driver.
  2809. The CSAM driver may process this call or may return 'daAbortFailErr'. This call can
  2810. be called only in synchronous mode. Since the abort call makes references to fields in
  2811. the pb associated with the original call, this pb must not be disposed or or altered if
  2812. the original call completes before the abort call has completed.
  2813. */
  2814.  
  2815. #if defined(powerc) || defined (__powerc)
  2816. #pragma options align=mac68k
  2817. #endif
  2818. struct DirAbortPB {
  2819.     Ptr                            qLink;
  2820.     long                        reserved1;
  2821.     long                        reserved2;
  2822.     DirIOCompletionUPP            ioCompletion;
  2823.     OSErr                        ioResult;
  2824.     unsigned long                saveA5;
  2825.     short                        reqCode;
  2826.     long                        reserved[2];
  2827.     AddrBlock                    serverHint;
  2828.     short                        dsRefNum;
  2829.     unsigned long                callID;
  2830.     AuthIdentity                identity;
  2831.     long                        gReserved1;
  2832.     long                        gReserved2;
  2833.     long                        gReserved3;
  2834.     long                        clientData;
  2835.     union DirParamBlock         *pb;            /*  --> pb for the call which must be aborted */
  2836. };
  2837. #if defined(powerc) || defined(__powerc)
  2838. #pragma options align=reset
  2839. #endif
  2840.  
  2841. typedef struct DirAbortPB DirAbortPB;
  2842.  
  2843. /*
  2844. AddPseudonym:
  2845. An alternate name and type can be added to a given record. If allowDuplicate
  2846. is set the name and type will be added even if the same name and type already
  2847. exists.
  2848. */
  2849.  
  2850. #if defined(powerc) || defined (__powerc)
  2851. #pragma options align=mac68k
  2852. #endif
  2853. struct DirAddPseudonymPB {
  2854.     Ptr                            qLink;
  2855.     long                        reserved1;
  2856.     long                        reserved2;
  2857.     DirIOCompletionUPP            ioCompletion;
  2858.     OSErr                        ioResult;
  2859.     unsigned long                saveA5;
  2860.     short                        reqCode;
  2861.     long                        reserved[2];
  2862.     AddrBlock                    serverHint;
  2863.     short                        dsRefNum;
  2864.     unsigned long                callID;
  2865.     AuthIdentity                identity;
  2866.     long                        gReserved1;
  2867.     long                        gReserved2;
  2868.     long                        gReserved3;
  2869.     long                        clientData;
  2870.     RecordIDPtr                    aRecord;
  2871.     RStringPtr                    pseudonymName;
  2872.     RStringPtr                    pseudonymType;
  2873.     Boolean                        allowDuplicate;
  2874. };
  2875. #if defined(powerc) || defined(__powerc)
  2876. #pragma options align=reset
  2877. #endif
  2878.  
  2879. typedef struct DirAddPseudonymPB DirAddPseudonymPB;
  2880.  
  2881. /*
  2882. DeletePseudonym:
  2883. An alternate name and type for a given record can be deleted.
  2884. */
  2885.  
  2886. #if defined(powerc) || defined (__powerc)
  2887. #pragma options align=mac68k
  2888. #endif
  2889. struct DirDeletePseudonymPB {
  2890.     Ptr                            qLink;
  2891.     long                        reserved1;
  2892.     long                        reserved2;
  2893.     DirIOCompletionUPP            ioCompletion;
  2894.     OSErr                        ioResult;
  2895.     unsigned long                saveA5;
  2896.     short                        reqCode;
  2897.     long                        reserved[2];
  2898.     AddrBlock                    serverHint;
  2899.     short                        dsRefNum;
  2900.     unsigned long                callID;
  2901.     AuthIdentity                identity;
  2902.     long                        gReserved1;
  2903.     long                        gReserved2;
  2904.     long                        gReserved3;
  2905.     long                        clientData;
  2906.     RecordIDPtr                    aRecord;
  2907.     RStringPtr                    pseudonymName;
  2908.     RStringPtr                    pseudonymType;
  2909. };
  2910. #if defined(powerc) || defined(__powerc)
  2911. #pragma options align=reset
  2912. #endif
  2913.  
  2914. typedef struct DirDeletePseudonymPB DirDeletePseudonymPB;
  2915.  
  2916. /*
  2917.     AddAlias:
  2918.     This call can be used to create an alias  record. The alias
  2919.     can be created either in the same or different cluster. ADAS will not support
  2920.     this call for this release. A new catalog capability flag 'kSupportsAlias' will indicate
  2921.     if the catalog supports this call. PAB's will support this call. For the PAB implementation,
  2922.     this call will create a record with the name and type specified an aRecord.
  2923.     This call works exactly like AddRecord.
  2924.     If 'allowDuplicate' is false and another record with same name and type already exists
  2925.     'daNoDupAllowed' error will be returned.
  2926. */
  2927.  
  2928. #if defined(powerc) || defined (__powerc)
  2929. #pragma options align=mac68k
  2930. #endif
  2931. struct DirAddAliasPB {
  2932.     Ptr                            qLink;
  2933.     long                        reserved1;
  2934.     long                        reserved2;
  2935.     DirIOCompletionUPP            ioCompletion;
  2936.     OSErr                        ioResult;
  2937.     unsigned long                saveA5;
  2938.     short                        reqCode;
  2939.     long                        reserved[2];
  2940.     AddrBlock                    serverHint;
  2941.     short                        dsRefNum;
  2942.     unsigned long                callID;
  2943.     AuthIdentity                identity;
  2944.     long                        gReserved1;
  2945.     long                        gReserved2;
  2946.     long                        gReserved3;
  2947.     long                        clientData;
  2948.     RecordIDPtr                    aRecord;
  2949.     Boolean                        allowDuplicate;
  2950. };
  2951. #if defined(powerc) || defined(__powerc)
  2952. #pragma options align=reset
  2953. #endif
  2954.  
  2955. typedef struct DirAddAliasPB DirAddAliasPB;
  2956.  
  2957. /*
  2958. DirFindValue:
  2959. This call can be used to find the occurrence of a value. The value
  2960. to be matched is passed in the buffer 'matchingData' field. The current
  2961. ADAP/PAB implementation will match a maximum of 32 bytes of data.
  2962. For attribute values in the PAB/ADAP implementation, only the first 32 bytes will
  2963. be used for comparing the occurrence of data. Search can be restricted to
  2964. a particular record and/or attribute type by specifying 'aRecord' or 'aType'.
  2965. After finding one occurrence, 'startingRecord' and 'startingAttribute'
  2966. can be specified to find the next occurrence of the same value.
  2967. 'sortDirection' can be specified with starting values to search forward or backward.
  2968. When a matching value is found, the 'recordFound' indicates the reccordID in which the
  2969. data occurrence was found, 'attributeFound' indicates the attribute with in which the
  2970. matching data was found. ADAP/PAB implementation returns only the type and creationID of
  2971. attributes. Catalogs which don't support creationIDs may return the
  2972. complete value; hence this call may need a buffer to hold the data. For ADAP/PAB implementations
  2973. the user has to make a DirLookup call to get the actual data. 'recordFound' and
  2974. 'attributeFound' can be used to initialize 'startingRecord' and 'startingAttribute' to
  2975. find the next occurrence of the value.
  2976. */
  2977.  
  2978. #if defined(powerc) || defined (__powerc)
  2979. #pragma options align=mac68k
  2980. #endif
  2981. struct DirFindValuePB {
  2982.     Ptr                            qLink;
  2983.     long                        reserved1;
  2984.     long                        reserved2;
  2985.     DirIOCompletionUPP            ioCompletion;
  2986.     OSErr                        ioResult;
  2987.     unsigned long                saveA5;
  2988.     short                        reqCode;
  2989.     long                        reserved[2];
  2990.     AddrBlock                    serverHint;
  2991.     short                        dsRefNum;
  2992.     unsigned long                callID;
  2993.     AuthIdentity                identity;
  2994.     long                        gReserved1;
  2995.     long                        gReserved2;
  2996.     long                        gReserved3;
  2997.     long                        clientData;
  2998.     PackedRLIPtr                aRLI;                /*  --> an RLI specifying the cluster to be enumerated */
  2999.     LocalRecordIDPtr            aRecord;            /*  --> if not nil, look only in this record */
  3000.     AttributeTypePtr            attrType;            /*  --> if not nil, look only in this attribute type */
  3001.     LocalRecordIDPtr            startingRecord;        /*  --> record in which to start searching */
  3002.     AttributePtr                startingAttribute;    /*  --> attribute in which to start searching */
  3003.     LocalRecordIDPtr            recordFound;        /* <--  record in which data was found */
  3004.     Attribute                    attributeFound;        /* <--  attribute in which data was found */
  3005.     unsigned long                matchSize;            /*  --> length of matching bytes */
  3006.     Ptr                            matchingData;        /*  --> data bytes to be matched in search */
  3007.     DirSortDirection            sortDirection;        /*  --> sort direction (forwards or backwards) */
  3008. };
  3009. #if defined(powerc) || defined(__powerc)
  3010. #pragma options align=reset
  3011. #endif
  3012.  
  3013. typedef struct DirFindValuePB DirFindValuePB;
  3014.  
  3015. /*
  3016. EnumeratePseudonymGet:
  3017. This call can be used to enumerate the existing pseudonyms for
  3018. a given record specified in 'aRecord'. A starting point can be specified
  3019. by 'startingName' and 'startingType'. If the 'includeStartingPoint' boolean
  3020. is true and a starting point is specified, the name specified by startingName
  3021. and startingType also is returned in the results, if it exists. If this is set to false,
  3022. the pseudonym in startingName and Type is not included.
  3023. Pseudonyms returned in the 'getBuffer' can be extracted by making an
  3024. EnumeratePseudonymParse call. The results will consist of a RecordID with the
  3025. name and type of the pseudonym. If the buffer could not hold all the results, then
  3026. 'kOCEMoreData' error will be returned. The user will be able to continue the call by
  3027. using the last result returned as starting point for the next call.
  3028. */
  3029.  
  3030. #if defined(powerc) || defined (__powerc)
  3031. #pragma options align=mac68k
  3032. #endif
  3033. struct DirEnumeratePseudonymGetPB {
  3034.     Ptr                            qLink;
  3035.     long                        reserved1;
  3036.     long                        reserved2;
  3037.     DirIOCompletionUPP            ioCompletion;
  3038.     OSErr                        ioResult;
  3039.     unsigned long                saveA5;
  3040.     short                        reqCode;
  3041.     long                        reserved[2];
  3042.     AddrBlock                    serverHint;
  3043.     short                        dsRefNum;
  3044.     unsigned long                callID;
  3045.     AuthIdentity                identity;
  3046.     long                        gReserved1;
  3047.     long                        gReserved2;
  3048.     long                        gReserved3;
  3049.     long                        clientData;
  3050.     RecordIDPtr                    aRecord;
  3051.     RStringPtr                    startingName;
  3052.     RStringPtr                    startingType;
  3053.     long                        dReserved;
  3054.     long                        eReserved;
  3055.     long                        fReserved;
  3056.     long                        gReserved;
  3057.     long                        hReserved;
  3058.     Boolean                        includeStartingPoint;    /*  --> if true return the Pseudonym specified by starting point will be included */
  3059.     Byte                        padByte;
  3060.     short                        i1Reserved;
  3061.     Ptr                            getBuffer;
  3062.     unsigned long                getBufferSize;
  3063. };
  3064. #if defined(powerc) || defined(__powerc)
  3065. #pragma options align=reset
  3066. #endif
  3067.  
  3068. typedef struct DirEnumeratePseudonymGetPB DirEnumeratePseudonymGetPB;
  3069.  
  3070. /* The call-back function is defined as follows: */
  3071. typedef pascal Boolean (*ForEachRecordIDProcPtr)(long clientData, const RecordID *recordID);
  3072.  
  3073. enum {
  3074.     uppForEachRecordIDProcInfo = kPascalStackBased
  3075.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3076.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3077.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RecordID*)))
  3078. };
  3079.  
  3080. #if USESROUTINEDESCRIPTORS
  3081. typedef UniversalProcPtr ForEachRecordIDUPP;
  3082.  
  3083. #define CallForEachRecordIDProc(userRoutine, clientData, recordID)        \
  3084.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordIDProcInfo, (clientData), (recordID))
  3085. #define NewForEachRecordIDProc(userRoutine)        \
  3086.         (ForEachRecordIDUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordIDProcInfo, GetCurrentISA())
  3087. #else
  3088. typedef ForEachRecordIDProcPtr ForEachRecordIDUPP;
  3089.  
  3090. #define CallForEachRecordIDProc(userRoutine, clientData, recordID)        \
  3091.         (*(userRoutine))((clientData), (recordID))
  3092. #define NewForEachRecordIDProc(userRoutine)        \
  3093.         (ForEachRecordIDUPP)(userRoutine)
  3094. #endif
  3095.  
  3096. typedef ForEachRecordIDUPP ForEachRecordID;
  3097.  
  3098. /*
  3099. EnumeratePseudonymParse:
  3100. The pseudonyms returned in the 'getBuffer' from the EnumeratePseudonymGet call
  3101. can be extracted by using the EnumeratePseudonymParse call. 'eachRecordID'
  3102. will be called for each pseudonym.
  3103.  
  3104. Returning true from any call-back will terminate the EnumeratePseudonymParse call.
  3105.  
  3106. For synchronous calls, the call-back routine actually runs as part of the same thread
  3107. of execution as the thread that made the EnumeratePseudonymParse call.  That means that the
  3108. same low-memory globals, A5, stack, etc. are in effect during the call-back
  3109. that were in effect when the call was made.  Because of this, the call-back
  3110. routine has the same restrictions as the caller of EnumeratePseudonymParse:
  3111. if EnumeratePseudonymParse was not called from interrupt level, then the call-
  3112. back routine can allocate memory. For asynchronous calls, call-back routine is
  3113. like a ioCompletion except that A5 will be preserved for the application.
  3114. */
  3115.  
  3116. #if defined(powerc) || defined (__powerc)
  3117. #pragma options align=mac68k
  3118. #endif
  3119. struct DirEnumeratePseudonymParsePB {
  3120.     Ptr                            qLink;
  3121.     long                        reserved1;
  3122.     long                        reserved2;
  3123.     DirIOCompletionUPP            ioCompletion;
  3124.     OSErr                        ioResult;
  3125.     unsigned long                saveA5;
  3126.     short                        reqCode;
  3127.     long                        reserved[2];
  3128.     AddrBlock                    serverHint;
  3129.     short                        dsRefNum;
  3130.     unsigned long                callID;
  3131.     AuthIdentity                identity;
  3132.     long                        gReserved1;
  3133.     long                        gReserved2;
  3134.     long                        gReserved3;
  3135.     long                        clientData;
  3136.     RecordIDPtr                    aRecord;        /*  --> same as DirEnumerateAliasesGetPB */
  3137.     long                        bReserved;
  3138.     long                        cReserved;
  3139.     ForEachRecordID                eachRecordID;
  3140.     long                        eReserved;
  3141.     long                        fReserved;
  3142.     long                        gReserved;
  3143.     long                        hReserved;
  3144.     long                        iReserved;
  3145.     Ptr                            getBuffer;
  3146.     unsigned long                getBufferSize;
  3147. };
  3148. #if defined(powerc) || defined(__powerc)
  3149. #pragma options align=reset
  3150. #endif
  3151.  
  3152. typedef struct DirEnumeratePseudonymParsePB DirEnumeratePseudonymParsePB;
  3153.  
  3154. /* GetNameAndType */
  3155.  
  3156. #if defined(powerc) || defined (__powerc)
  3157. #pragma options align=mac68k
  3158. #endif
  3159. struct DirGetNameAndTypePB {
  3160.     Ptr                            qLink;
  3161.     long                        reserved1;
  3162.     long                        reserved2;
  3163.     DirIOCompletionUPP            ioCompletion;
  3164.     OSErr                        ioResult;
  3165.     unsigned long                saveA5;
  3166.     short                        reqCode;
  3167.     long                        reserved[2];
  3168.     AddrBlock                    serverHint;
  3169.     short                        dsRefNum;
  3170.     unsigned long                callID;
  3171.     AuthIdentity                identity;
  3172.     long                        gReserved1;
  3173.     long                        gReserved2;
  3174.     long                        gReserved3;
  3175.     long                        clientData;
  3176.     RecordIDPtr                    aRecord;
  3177. };
  3178. #if defined(powerc) || defined(__powerc)
  3179. #pragma options align=reset
  3180. #endif
  3181.  
  3182. typedef struct DirGetNameAndTypePB DirGetNameAndTypePB;
  3183.  
  3184. /*
  3185. aRecord must contain valid RLI and a CreationID.  It
  3186. must also contain pointers to maximum-length RStrings (name and type fields)
  3187. in which will be returned the record's distinguished name and type.
  3188. */
  3189.  
  3190.  
  3191. /*
  3192. SetNameAndType:
  3193. This call can be used to change a name and type for a record. The record
  3194. to be renamed is specified using 'aRecord'.
  3195. 'newName' and 'newType' indicate the name and type to be set.
  3196. 'allowDuplicate' if true indicates that name is to be set even if another
  3197. name and type exactly matches the newName and newType specified.
  3198.  
  3199. 'newName' and 'newType' are required since the catalogs not supporting
  3200. CreationID require name and type fields in the recordID to identify a given
  3201. record.
  3202. */
  3203.  
  3204. #if defined(powerc) || defined (__powerc)
  3205. #pragma options align=mac68k
  3206. #endif
  3207. struct DirSetNameAndTypePB {
  3208.     Ptr                            qLink;
  3209.     long                        reserved1;
  3210.     long                        reserved2;
  3211.     DirIOCompletionUPP            ioCompletion;
  3212.     OSErr                        ioResult;
  3213.     unsigned long                saveA5;
  3214.     short                        reqCode;
  3215.     long                        reserved[2];
  3216.     AddrBlock                    serverHint;
  3217.     short                        dsRefNum;
  3218.     unsigned long                callID;
  3219.     AuthIdentity                identity;
  3220.     long                        gReserved1;
  3221.     long                        gReserved2;
  3222.     long                        gReserved3;
  3223.     long                        clientData;
  3224.     RecordIDPtr                    aRecord;
  3225.     Boolean                        allowDuplicate;
  3226.     Byte                        padByte;
  3227.     RStringPtr                    newName;
  3228.     RStringPtr                    newType;
  3229. };
  3230. #if defined(powerc) || defined(__powerc)
  3231. #pragma options align=reset
  3232. #endif
  3233.  
  3234. typedef struct DirSetNameAndTypePB DirSetNameAndTypePB;
  3235.  
  3236. /*
  3237. DirGetMetaRecordInfo: This call can be made to obtain
  3238. the MetaRecordInfo for a given record. Information returned
  3239. is 16 bytes of OPAQUE information about the record.
  3240. */
  3241.  
  3242. #if defined(powerc) || defined (__powerc)
  3243. #pragma options align=mac68k
  3244. #endif
  3245. struct DirGetRecordMetaInfoPB {
  3246.     Ptr                            qLink;
  3247.     long                        reserved1;
  3248.     long                        reserved2;
  3249.     DirIOCompletionUPP            ioCompletion;
  3250.     OSErr                        ioResult;
  3251.     unsigned long                saveA5;
  3252.     short                        reqCode;
  3253.     long                        reserved[2];
  3254.     AddrBlock                    serverHint;
  3255.     short                        dsRefNum;
  3256.     unsigned long                callID;
  3257.     AuthIdentity                identity;
  3258.     long                        gReserved1;
  3259.     long                        gReserved2;
  3260.     long                        gReserved3;
  3261.     long                        clientData;
  3262.     RecordIDPtr                    aRecord;
  3263.     DirMetaInfo                    metaInfo;
  3264. };
  3265. #if defined(powerc) || defined(__powerc)
  3266. #pragma options align=reset
  3267. #endif
  3268.  
  3269. typedef struct DirGetRecordMetaInfoPB DirGetRecordMetaInfoPB;
  3270.  
  3271. /*
  3272. DirGetDNodeMetaInfo: This call can be made to obtain
  3273. the DNodeMetaInfo for a given Packed RLI. Information returned
  3274. is 16 bytes of OPAQUE information about the DNode.
  3275. */
  3276.  
  3277. #if defined(powerc) || defined (__powerc)
  3278. #pragma options align=mac68k
  3279. #endif
  3280. struct DirGetDNodeMetaInfoPB {
  3281.     Ptr                            qLink;
  3282.     long                        reserved1;
  3283.     long                        reserved2;
  3284.     DirIOCompletionUPP            ioCompletion;
  3285.     OSErr                        ioResult;
  3286.     unsigned long                saveA5;
  3287.     short                        reqCode;
  3288.     long                        reserved[2];
  3289.     AddrBlock                    serverHint;
  3290.     short                        dsRefNum;
  3291.     unsigned long                callID;
  3292.     AuthIdentity                identity;
  3293.     long                        gReserved1;
  3294.     long                        gReserved2;
  3295.     long                        gReserved3;
  3296.     long                        clientData;
  3297.     PackedRLIPtr                pRLI;
  3298.     DirMetaInfo                    metaInfo;
  3299. };
  3300. #if defined(powerc) || defined(__powerc)
  3301. #pragma options align=reset
  3302. #endif
  3303.  
  3304. typedef struct DirGetDNodeMetaInfoPB DirGetDNodeMetaInfoPB;
  3305.  
  3306. /*
  3307. EnumerateDirectoriesGet:
  3308. A user can enumerate all the catalogs installed. This includes installed
  3309. ADAP and CSAM catalogs. The user can specify a signature as input to restrict
  3310. the results. kDirADAPKind will return only ADAP catalogs, kDirDSAMKind
  3311. will return all CSAM catalogs. kDirAllKinds will get both ADAP & CSAM catalogs.
  3312. A specific signature (e.g. X.500) may be used to get catalogs with an X.500 signature.
  3313. The information for each catalog returned will have directoryName, discriminator and features.
  3314.  
  3315. If the user receives 'noErr' or 'kOCEMoreData', the buffer will contain valid results. A user
  3316. can extract the results in the 'getBuffer' by making an DirEnumerateDirectories call.
  3317.  
  3318. If 'kOCEMoreData' is received, the user can continue enumeration by using the last catalog and
  3319. discriminator as startingDirectoryName and staringDirDiscriminator in the next call.
  3320.  
  3321. If 'includeStartingPoint' is true and a starting point is specified,
  3322. the staring point will be returned in the result. If false, it is not included.
  3323. */
  3324.  
  3325. #if defined(powerc) || defined (__powerc)
  3326. #pragma options align=mac68k
  3327. #endif
  3328. struct DirEnumerateDirectoriesGetPB {
  3329.     Ptr                            qLink;
  3330.     long                        reserved1;
  3331.     long                        reserved2;
  3332.     DirIOCompletionUPP            ioCompletion;
  3333.     OSErr                        ioResult;
  3334.     unsigned long                saveA5;
  3335.     short                        reqCode;
  3336.     long                        reserved[2];
  3337.     AddrBlock                    serverHint;
  3338.     short                        dsRefNum;
  3339.     unsigned long                callID;
  3340.     AuthIdentity                identity;
  3341.     long                        gReserved1;
  3342.     long                        gReserved2;
  3343.     long                        gReserved3;
  3344.     long                        clientData;
  3345.     OCEDirectoryKind            directoryKind;
  3346.     DirectoryNamePtr            startingDirectoryName;
  3347.     DirDiscriminator            startingDirDiscriminator;
  3348.     long                        eReserved;
  3349.     long                        fReserved;
  3350.     long                        gReserved;
  3351.     long                        hReserved;
  3352.     Boolean                        includeStartingPoint;
  3353.     Byte                        padByte;
  3354.     short                        i1Reserved;
  3355.     Ptr                            getBuffer;
  3356.     unsigned long                getBufferSize;
  3357. };
  3358. #if defined(powerc) || defined(__powerc)
  3359. #pragma options align=reset
  3360. #endif
  3361.  
  3362. typedef struct DirEnumerateDirectoriesGetPB DirEnumerateDirectoriesGetPB;
  3363.  
  3364. typedef pascal Boolean (*ForEachDirectoryProcPtr)(long clientData, const DirectoryName *dirName, const DirDiscriminator *discriminator, DirGestalt features);
  3365.  
  3366. enum {
  3367.     uppForEachDirectoryProcInfo = kPascalStackBased
  3368.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3369.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3370.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirectoryName*)))
  3371.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DirDiscriminator*)))
  3372.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DirGestalt)))
  3373. };
  3374.  
  3375. #if USESROUTINEDESCRIPTORS
  3376. typedef UniversalProcPtr ForEachDirectoryUPP;
  3377.  
  3378. #define CallForEachDirectoryProc(userRoutine, clientData, dirName, discriminator, features)        \
  3379.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDirectoryProcInfo, (clientData), (dirName), (discriminator), (features))
  3380. #define NewForEachDirectoryProc(userRoutine)        \
  3381.         (ForEachDirectoryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDirectoryProcInfo, GetCurrentISA())
  3382. #else
  3383. typedef ForEachDirectoryProcPtr ForEachDirectoryUPP;
  3384.  
  3385. #define CallForEachDirectoryProc(userRoutine, clientData, dirName, discriminator, features)        \
  3386.         (*(userRoutine))((clientData), (dirName), (discriminator), (features))
  3387. #define NewForEachDirectoryProc(userRoutine)        \
  3388.         (ForEachDirectoryUPP)(userRoutine)
  3389. #endif
  3390.  
  3391. typedef ForEachDirectoryUPP ForEachDirectory;
  3392.  
  3393. /*
  3394. EnumerateDirectoriesParse:
  3395. The catalog info returned in 'getBuffer' from the EnumerateDirectoriesGet call
  3396. can be extracted using the EnumerateDirectoriesParse call. 'eachDirectory' will
  3397. be called for each catalog.
  3398.  
  3399. Returning true from any call-back will terminate the EnumerateDirectoriesParse call.
  3400.  
  3401. For synchronous calls, the call-back routine actually runs as part of the same thread
  3402. of execution as the thread that made the EnumerateDirectoriesParse call.  That means that the
  3403. same low-memory globals, A5, stack, etc. are in effect during the call-back
  3404. that were in effect when the call was made.  Because of this, the call-back
  3405. routine has the same restrictions as the caller of EnumerateDirectoriesParse:
  3406. if EnumerateDirectoriesParse was not called from interrupt level, then the call-
  3407. back routine can allocate memory. For asynchronous calls, call-back routine is
  3408. like a ioCompletion except that A5 will be preserved for the application.
  3409.  
  3410. eachDirectory will be called each time to return to the client a
  3411. DirectoryName, DirDiscriminator, and features for that catalog.
  3412. */
  3413.  
  3414. #if defined(powerc) || defined (__powerc)
  3415. #pragma options align=mac68k
  3416. #endif
  3417. struct DirEnumerateDirectoriesParsePB {
  3418.     Ptr                            qLink;
  3419.     long                        reserved1;
  3420.     long                        reserved2;
  3421.     DirIOCompletionUPP            ioCompletion;
  3422.     OSErr                        ioResult;
  3423.     unsigned long                saveA5;
  3424.     short                        reqCode;
  3425.     long                        reserved[2];
  3426.     AddrBlock                    serverHint;
  3427.     short                        dsRefNum;
  3428.     unsigned long                callID;
  3429.     AuthIdentity                identity;
  3430.     long                        gReserved1;
  3431.     long                        gReserved2;
  3432.     long                        gReserved3;
  3433.     long                        clientData;
  3434.     long                        aReserved;
  3435.     long                        bReserved;
  3436.     long                        cReserved;
  3437.     long                        dReserved;
  3438.     ForEachDirectory            eachDirectory;
  3439.     long                        fReserved;
  3440.     long                        gReserved;
  3441.     long                        hReserved;
  3442.     long                        iReserved;
  3443.     Ptr                            getBuffer;
  3444.     unsigned long                getBufferSize;
  3445. };
  3446. #if defined(powerc) || defined(__powerc)
  3447. #pragma options align=reset
  3448. #endif
  3449.  
  3450. typedef struct DirEnumerateDirectoriesParsePB DirEnumerateDirectoriesParsePB;
  3451.  
  3452. /*
  3453. The Following five call are specific to ADAP Catalogs. Toolbox
  3454. remembers a list of catalogs across boots. If any catalog service
  3455. call is intended for a ADAP catalog, then it must be in the list.
  3456. In order for managing this list, A client (Probably DE will use these
  3457. calls.
  3458. DirAddADAPDirectoryPB: Add a new ADAP catalog to the list.
  3459. DirRemoveADAPDirectory: Remove a ADAP catalog from the list.
  3460. DirNetSearchADAPDirectoriesGet:   search an internet for adas catalogs.
  3461. DirNetSearchADAPDirectoriesParse: extract the results obtained NetSearchADAPDirectoriesGet.
  3462. DirFindADAPDirectoryByNetSearch: Find a specified catalog through net search.
  3463. */
  3464.  
  3465. /*
  3466. NetSearchADAPDirectoriesGet:
  3467. This call can be used to make a network wide search for finding ADAP catalogs.
  3468. This call will be supported only by 'ADAP' and involve highly expensive
  3469. network operations, so the user is advised to use utmost discretion before
  3470. making this call. The results will be collected in the 'getbuffer' and can be
  3471. extracted using NetSearchADAPDirectoriesParse call. The directoryName,
  3472. the directoryDiscriminator, features and serverHint (AppleTalk address for
  3473. a PathFinder serving that catalog) are collected for each catalog found
  3474. on the network. If buffer is too small to hold all the catalogs found on
  3475. the network, a 'kOCEMoreData' error will be returned.
  3476. */
  3477.  
  3478. #if defined(powerc) || defined (__powerc)
  3479. #pragma options align=mac68k
  3480. #endif
  3481. struct DirNetSearchADAPDirectoriesGetPB {
  3482.     Ptr                            qLink;
  3483.     long                        reserved1;
  3484.     long                        reserved2;
  3485.     DirIOCompletionUPP            ioCompletion;
  3486.     OSErr                        ioResult;
  3487.     unsigned long                saveA5;
  3488.     short                        reqCode;
  3489.     long                        reserved[2];
  3490.     AddrBlock                    serverHint;
  3491.     short                        dsRefNum;
  3492.     unsigned long                callID;
  3493.     AuthIdentity                identity;
  3494.     long                        gReserved1;
  3495.     long                        gReserved2;
  3496.     long                        gReserved3;
  3497.     long                        clientData;
  3498.     Ptr                            getBuffer;
  3499.     unsigned long                getBufferSize;
  3500.     long                        cReserved;
  3501. };
  3502. #if defined(powerc) || defined(__powerc)
  3503. #pragma options align=reset
  3504. #endif
  3505.  
  3506. typedef struct DirNetSearchADAPDirectoriesGetPB DirNetSearchADAPDirectoriesGetPB;
  3507.  
  3508. typedef pascal Boolean (*ForEachADAPDirectoryProcPtr)(long clientData, const DirectoryName *dirName, const DirDiscriminator *discriminator, DirGestalt features, AddrBlock serverHint);
  3509.  
  3510. enum {
  3511.     uppForEachADAPDirectoryProcInfo = kPascalStackBased
  3512.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3513.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3514.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirectoryName*)))
  3515.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DirDiscriminator*)))
  3516.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DirGestalt)))
  3517.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AddrBlock)))
  3518. };
  3519.  
  3520. #if USESROUTINEDESCRIPTORS
  3521. typedef UniversalProcPtr ForEachADAPDirectoryUPP;
  3522.  
  3523. #define CallForEachADAPDirectoryProc(userRoutine, clientData, dirName, discriminator, features, serverHint)        \
  3524.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachADAPDirectoryProcInfo, (clientData), (dirName), (discriminator), (features), (serverHint))
  3525. #define NewForEachADAPDirectoryProc(userRoutine)        \
  3526.         (ForEachADAPDirectoryUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachADAPDirectoryProcInfo, GetCurrentISA())
  3527. #else
  3528. typedef ForEachADAPDirectoryProcPtr ForEachADAPDirectoryUPP;
  3529.  
  3530. #define CallForEachADAPDirectoryProc(userRoutine, clientData, dirName, discriminator, features, serverHint)        \
  3531.         (*(userRoutine))((clientData), (dirName), (discriminator), (features), (serverHint))
  3532. #define NewForEachADAPDirectoryProc(userRoutine)        \
  3533.         (ForEachADAPDirectoryUPP)(userRoutine)
  3534. #endif
  3535.  
  3536. typedef ForEachADAPDirectoryUPP ForEachADAPDirectory;
  3537.  
  3538. /*
  3539. DirNetSearchADAPDirectoriesParse:
  3540. This call can be used to extract the results obtained in the 'getBuffer'.
  3541. The directoryName, directoryDiscriminator, features and
  3542. serverHint (AppleTalk address for a PathFinder serving that catalog) are
  3543. returned in each call-back. These values may be used to make an
  3544. AddADAPDirectory call.
  3545.  
  3546. Returning TRUE from any call-back will terminate the NetSearchADAPDirectoriesParse request.
  3547.  
  3548. For synchronous calls, the call-back routine actually runs as part of the same thread
  3549. of execution as the thread that made the DirNetSearchADAPDirectoriesParse call. That means that the
  3550. same low-memory globals, A5, stack, etc. are in effect during the call-back
  3551. that were in effect when the call was made.  Because of this, the call-back
  3552. routine has the same restrictions as the caller of DirNetSearchADAPDirectoriesParse:
  3553. if DirNetSearchADAPDirectoriesParse was not called from interrupt level, then the call-
  3554. back routine can allocate memory. For asynchronous calls, call-back routine is
  3555. like a ioCompletion except that A5 will be preserved for the application.
  3556. */
  3557.  
  3558. #if defined(powerc) || defined (__powerc)
  3559. #pragma options align=mac68k
  3560. #endif
  3561. struct DirNetSearchADAPDirectoriesParsePB {
  3562.     Ptr                            qLink;
  3563.     long                        reserved1;
  3564.     long                        reserved2;
  3565.     DirIOCompletionUPP            ioCompletion;
  3566.     OSErr                        ioResult;
  3567.     unsigned long                saveA5;
  3568.     short                        reqCode;
  3569.     long                        reserved[2];
  3570.     AddrBlock                    serverHint;
  3571.     short                        dsRefNum;
  3572.     unsigned long                callID;
  3573.     AuthIdentity                identity;
  3574.     long                        gReserved1;
  3575.     long                        gReserved2;
  3576.     long                        gReserved3;
  3577.     long                        clientData;
  3578.     Ptr                            getBuffer;
  3579.     unsigned long                getBufferSize;
  3580.     ForEachADAPDirectory        eachADAPDirectory;
  3581. };
  3582. #if defined(powerc) || defined(__powerc)
  3583. #pragma options align=reset
  3584. #endif
  3585.  
  3586. typedef struct DirNetSearchADAPDirectoriesParsePB DirNetSearchADAPDirectoriesParsePB;
  3587.  
  3588. /*
  3589. DirFindADAPDirectoryByNetSearch:
  3590. This call can be used to make a network wide search to find an ADAP catalog.
  3591. This call will be supported only by 'ADAP' and involves highly expensive
  3592. network operations, so the user is advised to use utmost discretion before
  3593. making this call. The catalog is specified using directoryName and discriminator.
  3594. If 'addToOCESetup' is true, the catalog will be automatically added to the setup
  3595. list and will be visible through the EnumerateDirectories call and also
  3596. also a creationID to the directoryRecord will be returned.
  3597. If this parameter is set to 'false', the catalog will be added to temporary list
  3598. and will be available for making other catalog service calls. The catalogs
  3599. which are not in the preference catalog list will not be visible through the
  3600. EnumerateDirectories call.
  3601. */
  3602.  
  3603. #if defined(powerc) || defined (__powerc)
  3604. #pragma options align=mac68k
  3605. #endif
  3606. struct DirFindADAPDirectoryByNetSearchPB {
  3607.     Ptr                            qLink;
  3608.     long                        reserved1;
  3609.     long                        reserved2;
  3610.     DirIOCompletionUPP            ioCompletion;
  3611.     OSErr                        ioResult;
  3612.     unsigned long                saveA5;
  3613.     short                        reqCode;
  3614.     long                        reserved[2];
  3615.     AddrBlock                    serverHint;
  3616.     short                        dsRefNum;
  3617.     unsigned long                callID;
  3618.     AuthIdentity                identity;
  3619.     long                        gReserved1;
  3620.     long                        gReserved2;
  3621.     long                        gReserved3;
  3622.     long                        clientData;
  3623.     DirectoryNamePtr            directoryName;        /*  --> catalog name */
  3624.     DirDiscriminator            discriminator;        /*  --> discriminate between dup catalog names */
  3625.     Boolean                        addToOCESetup;        /*  --> add this catalog to OCE Setup List */
  3626.     Byte                        padByte;
  3627.     CreationID                    directoryRecordCID;    /* <--  creationID for the catalog record */
  3628. };
  3629. #if defined(powerc) || defined(__powerc)
  3630. #pragma options align=reset
  3631. #endif
  3632.  
  3633. typedef struct DirFindADAPDirectoryByNetSearchPB DirFindADAPDirectoryByNetSearchPB;
  3634.  
  3635. /*
  3636. DirAddADAPDirectory:
  3637. The catalog specified by 'directoryName' and 'discriminator' will be
  3638. added to the list of catalogs maintained by the Toolbox. Once added,
  3639. the catalog is available across boots, until the catalog is removed
  3640. explicitly through a DirRemoveADAPDirectory call.
  3641. If 'serverHint' is not nil, the address provided will be used
  3642. to contact a PathFinder for the catalog specified.
  3643. If 'serverHint' is nil or does not point to a valid PathFinder server
  3644. for that catalog, this call will fail.
  3645. If 'addToOCESetup' is true, the catalog will be automatically added to the setup
  3646. catalog list and will be visible through EnumerateDirectories calls and
  3647. also a creationID to the directoryRecord will be returned.
  3648. If this parameter is set to 'false', catalog will be added to temprary list
  3649. and will be available for making other catalog service calls. The catalogs
  3650. which are not in the setup  list will not be visible through
  3651. EnumerateDirectories call.
  3652. */
  3653.  
  3654. #if defined(powerc) || defined (__powerc)
  3655. #pragma options align=mac68k
  3656. #endif
  3657. struct DirAddADAPDirectoryPB {
  3658.     Ptr                            qLink;
  3659.     long                        reserved1;
  3660.     long                        reserved2;
  3661.     DirIOCompletionUPP            ioCompletion;
  3662.     OSErr                        ioResult;
  3663.     unsigned long                saveA5;
  3664.     short                        reqCode;
  3665.     long                        reserved[2];
  3666.     AddrBlock                    serverHint;
  3667.     short                        dsRefNum;
  3668.     unsigned long                callID;
  3669.     AuthIdentity                identity;
  3670.     long                        gReserved1;
  3671.     long                        gReserved2;
  3672.     long                        gReserved3;
  3673.     long                        clientData;
  3674.     DirectoryNamePtr            directoryName;        /*  --> catalog name */
  3675.     DirDiscriminator            discriminator;        /*  --> discriminate between dup catalog names */
  3676.     Boolean                        addToOCESetup;        /*  --> add this catalog to OCE Setup */
  3677.     Byte                        padByte;
  3678.     CreationID                    directoryRecordCID;    /* <--  creationID for the catalog record */
  3679. };
  3680. #if defined(powerc) || defined(__powerc)
  3681. #pragma options align=reset
  3682. #endif
  3683.  
  3684. typedef struct DirAddADAPDirectoryPB DirAddADAPDirectoryPB;
  3685.  
  3686. /*
  3687. GetDirectoryInfo:
  3688. DirGetDirectoryInfo will do:
  3689.  
  3690. If a 'dsRefNum' is non-Zero, the catalog information for
  3691.     the corresponding  PAB will be  returned.
  3692.  If 'dsRefNum' is zero and 'serverHint' is non-zero, If the
  3693.  'serverHint' points to a valid ADAP Catalog Server(Path Finder),
  3694.  the catalog information (i.e. directoryName, discriminator, features)
  3695.  for that catalog will be returned.
  3696.     If a  valid catalog name and discriminator are provided
  3697.     features (Set of capability flags) for that catalog will be returned.
  3698. */
  3699.  
  3700. #if defined(powerc) || defined (__powerc)
  3701. #pragma options align=mac68k
  3702. #endif
  3703. struct DirGetDirectoryInfoPB {
  3704.     Ptr                            qLink;
  3705.     long                        reserved1;
  3706.     long                        reserved2;
  3707.     DirIOCompletionUPP            ioCompletion;
  3708.     OSErr                        ioResult;
  3709.     unsigned long                saveA5;
  3710.     short                        reqCode;
  3711.     long                        reserved[2];
  3712.     AddrBlock                    serverHint;
  3713.     short                        dsRefNum;
  3714.     unsigned long                callID;
  3715.     AuthIdentity                identity;
  3716.     long                        gReserved1;
  3717.     long                        gReserved2;
  3718.     long                        gReserved3;
  3719.     long                        clientData;
  3720.     DirectoryNamePtr            directoryName;    /*  --> catalog name */
  3721.     DirDiscriminator            discriminator;    /* <--> descriminate between dup catalog names */
  3722.     DirGestalt                    features;        /* <--  capability bit flags */
  3723. };
  3724. #if defined(powerc) || defined(__powerc)
  3725. #pragma options align=reset
  3726. #endif
  3727.  
  3728. typedef struct DirGetDirectoryInfoPB DirGetDirectoryInfoPB;
  3729.  
  3730. #ifdef    __cplusplus
  3731. extern "C" {
  3732. #endif
  3733.  
  3734. /*
  3735. pass kThisRecordOwnerMask, kFriendsMask, kAuthenticatedInDNodeMask, kAuthenticatedInDirectoryMask,
  3736. kGuestMask, or kMeMask to this routine, and it will return a pointer to a
  3737. DSSpec that can be used in the Get or Set Access Controls calls.
  3738. */
  3739.  
  3740. extern pascal DSSpec *OCEGetAccessControlDSSpec(const CategoryMask categoryBitMask)
  3741.  THREEWORDINLINE(0x303C, 837, 0xAA5C);
  3742. #ifdef    __cplusplus
  3743. }
  3744. #endif
  3745.  
  3746. /*
  3747.  * Note on Access Controls:
  3748.  * Access control is based on a list model.
  3749.  * You can get access controls list which gives dsObject and accMask for each dsObject.
  3750.  * GetAccessControl can be limited to currently supplied identity by setting forCurrentUserOnly.
  3751.  * There are special DSObjects are defined in ADASTypes.h for each of the category
  3752.  * supported in ADAS Catalogs. (kOwner, kFriends, kAuthenticatedToCluster, 
  3753.  * kAuthenticatedToDirectory, kGuest) and DUGetActlDSSpec call can be used
  3754.  * to obtain appropraiate DSSpec before making set calls to ADAS catalogs.
  3755.  *
  3756.  */
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763. /*
  3764.     GetDNodeAccessControlGet:
  3765.     This call can be done to get back access control list for a DNode.
  3766.     pRLI -> RLI of the DNode whose access control list is sought
  3767.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  3768.                       the identity parameter will be returned other wise entire list
  3769.                       will be returned.
  3770.     startingDsObj  -> If this is not nil, list should be started after this object.
  3771.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  3772.                               results.
  3773.                               
  3774.     The results will be collected in the 'getBuffer' supplied by the user.
  3775.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  3776.      
  3777.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  3778.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  3779.     
  3780.     Results returned for each DSObject will contain DSSpecPtr and three sets of access mask. 
  3781.  
  3782. */
  3783.  
  3784.  
  3785. #if defined(powerc) || defined (__powerc)
  3786. #pragma options align=mac68k
  3787. #endif
  3788. struct DirGetDNodeAccessControlGetPB {
  3789.     Ptr                            qLink;
  3790.     long                        reserved1;
  3791.     long                        reserved2;
  3792.     DirIOCompletionUPP            ioCompletion;
  3793.     OSErr                        ioResult;
  3794.     unsigned long                saveA5;
  3795.     short                        reqCode;
  3796.     long                        reserved[2];
  3797.     AddrBlock                    serverHint;
  3798.     short                        dsRefNum;
  3799.     unsigned long                callID;
  3800.     AuthIdentity                identity;
  3801.     long                        gReserved1;
  3802.     long                        gReserved2;
  3803.     long                        gReserved3;
  3804.     long                        clientData;
  3805.     PackedRLIPtr                 pRLI;                 /*  -> RLI of the cluster whose access control list is sought  */
  3806.     long                        bReserved;           /*  -- unused */
  3807.     long                        cReserved;           /*  -- unused */
  3808.     long                        dReserved;           /*  -- unused */
  3809.     long                         eResreved;              /* --> */
  3810.     Boolean                        forCurrentUserOnly;     /* -->  */
  3811.     DSSpec                        *startingPoint;      /* --> starting Point */
  3812.     Boolean                        includeStartingPoint; /*  -> if true return the DsObject specified in starting point */ 
  3813.     Ptr                            getBuffer;             /*    -> */
  3814.     unsigned long                getBufferSize;         /*  -> */
  3815. };
  3816. #if defined(powerc) || defined(__powerc)
  3817. #pragma options align=reset
  3818. #endif
  3819.  
  3820. typedef struct DirGetDNodeAccessControlGetPB DirGetDNodeAccessControlGetPB;
  3821.  
  3822.  /* The Access Control call-back function is defined as follows: */
  3823. typedef pascal Boolean (*ForEachDNodeAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask defaultRecordAccMask, AccessMask defaultAttributeAccMask);
  3824.  
  3825. enum {
  3826.     uppForEachDNodeAccessControlProcInfo = kPascalStackBased
  3827.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3828.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3829.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  3830.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  3831.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  3832.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask)))
  3833. };
  3834.  
  3835. #if USESROUTINEDESCRIPTORS
  3836. typedef UniversalProcPtr ForEachDNodeAccessControlUPP;
  3837.  
  3838. #define CallForEachDNodeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, defaultRecordAccMask, defaultAttributeAccMask)        \
  3839.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachDNodeAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (defaultRecordAccMask), (defaultAttributeAccMask))
  3840. #define NewForEachDNodeAccessControlProc(userRoutine)        \
  3841.         (ForEachDNodeAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachDNodeAccessControlProcInfo, GetCurrentISA())
  3842. #else
  3843. typedef ForEachDNodeAccessControlProcPtr ForEachDNodeAccessControlUPP;
  3844.  
  3845. #define CallForEachDNodeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, defaultRecordAccMask, defaultAttributeAccMask)        \
  3846.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (defaultRecordAccMask), (defaultAttributeAccMask))
  3847. #define NewForEachDNodeAccessControlProc(userRoutine)        \
  3848.         (ForEachDNodeAccessControlUPP)(userRoutine)
  3849. #endif
  3850.  
  3851. typedef ForEachDNodeAccessControlUPP ForEachDNodeAccessControl;
  3852.  
  3853. /*
  3854.     GetDNodeAccessControlParse:
  3855.     After an GetDNodeAccessControlGet call has completed, 
  3856.     call GetDNodeAccessControlParse to parse through the buffer that
  3857.     that was filled in GetDNodeAccessControlGet.
  3858.     
  3859.     'eachObject' will be called each time to return to the client a
  3860.     DsObject and a set of three accMasks (three long words) for that object.
  3861.     Acceesmasks returned apply to the dsObject in the callback :
  3862.     1. Currently Active Access mask for the specified DNode.
  3863.     2. Default Access mask for any Record in the DNode
  3864.     3. Default Access mask for any Attribute in the DNode
  3865.     The clientData parameter that you pass in the parameter block will be passed
  3866.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  3867.     to allow you some way to match the call-back to the original call (for
  3868.     example, you make more then one aysynchronous GetDNodeAccessControlGet calls and you want to
  3869.     associate returned results in some way).
  3870.     
  3871.     The client should return FALSE from 'eachObject' to continue
  3872.     processing of the GetDNodeAccessControlParse request.  Returning TRUE will
  3873.     terminate the GetDNodeAccessControlParse request.
  3874.  
  3875.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  3876.     of execution as the thread that made the GetDNodeAccessControlParse call.  That means that the
  3877.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  3878.     that were in effect when the call was made.  Because of this, the call-back
  3879.     routine has the same restrictions as the caller of GetDNodeAccessControlParse:
  3880.     if GetDNodeAccessControlParse was not called from interrupt level, then the call-
  3881.     back routine can allocate memory. For asynchronous calls, call-back routine is
  3882.     like a ioCompletion except that A5 will be preserved for the application.
  3883.  
  3884.  
  3885. */
  3886.  
  3887. #if defined(powerc) || defined (__powerc)
  3888. #pragma options align=mac68k
  3889. #endif
  3890. struct DirGetDNodeAccessControlParsePB {
  3891.     Ptr                            qLink;
  3892.     long                        reserved1;
  3893.     long                        reserved2;
  3894.     DirIOCompletionUPP            ioCompletion;
  3895.     OSErr                        ioResult;
  3896.     unsigned long                saveA5;
  3897.     short                        reqCode;
  3898.     long                        reserved[2];
  3899.     AddrBlock                    serverHint;
  3900.     short                        dsRefNum;
  3901.     unsigned long                callID;
  3902.     AuthIdentity                identity;
  3903.     long                        gReserved1;
  3904.     long                        gReserved2;
  3905.     long                        gReserved3;
  3906.     long                        clientData;
  3907.     PackedRLIPtr                 pRLI;                    /*  -> RLI of the cluster  */
  3908.     long                        bReserved;              /*  -- unused */
  3909.     long                        cReserved;              /*  -- unused */
  3910.     long                        dReserved;              /*  -- unused */
  3911.     ForEachDNodeAccessControl    eachObject;             /* --> */
  3912.     Boolean                        forCurrentUserOnly;         /* -->  */
  3913.     DSSpec                        *startingPoint;         /* --> starting Point */
  3914.     Boolean                        includeStartingPoint;   /*  -> if true return the record specified in starting point */ 
  3915.     Ptr                            getBuffer;                /*    -> */
  3916.     unsigned long                getBufferSize;            /*  -> */
  3917. };
  3918. #if defined(powerc) || defined(__powerc)
  3919. #pragma options align=reset
  3920. #endif
  3921.  
  3922. typedef struct DirGetDNodeAccessControlParsePB DirGetDNodeAccessControlParsePB;
  3923.  
  3924. /*
  3925.     GetRecordAccessControlGet:
  3926.     This call can be done to get back access control list for a RecordID.
  3927.     aRecord -> RecordID to which access control list is sought
  3928.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  3929.                       the identity parameter will be returned other wise entire list
  3930.                       will be returned.
  3931.     startingDsObj  -> If this is not nil, list should be started after this object.
  3932.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  3933.                               results.
  3934.                               
  3935.     The results will be collected in the 'getBuffer' supplied by the user.
  3936.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  3937.      
  3938.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  3939.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  3940.     
  3941.     Results returned for each DSObject will contain DSSpecPtr and accMask. 
  3942.  
  3943. */
  3944.  
  3945. #if defined(powerc) || defined (__powerc)
  3946. #pragma options align=mac68k
  3947. #endif
  3948. struct DirGetRecordAccessControlGetPB {
  3949.     Ptr                            qLink;
  3950.     long                        reserved1;
  3951.     long                        reserved2;
  3952.     DirIOCompletionUPP            ioCompletion;
  3953.     OSErr                        ioResult;
  3954.     unsigned long                saveA5;
  3955.     short                        reqCode;
  3956.     long                        reserved[2];
  3957.     AddrBlock                    serverHint;
  3958.     short                        dsRefNum;
  3959.     unsigned long                callID;
  3960.     AuthIdentity                identity;
  3961.     long                        gReserved1;
  3962.     long                        gReserved2;
  3963.     long                        gReserved3;
  3964.     long                        clientData;
  3965.     RecordIDPtr                 aRecord;                /*  -> RecordID to which access control list is sought list is sought  */
  3966.     long                        bReserved;                   /*  -- unused */
  3967.     long                        cReserved;              /*  -- unused */
  3968.     long                        dReserved;              /*  -- unused */
  3969.     long                         eResreved;                 /* --> */
  3970.     Boolean                        forCurrentUserOnly;         /* -->  */
  3971.     DSSpec                        *startingPoint;         /* --> starting Point */
  3972.     Boolean                        includeStartingPoint;     /*  -> if true return the DsObject specified in starting point */ 
  3973.     Ptr                            getBuffer;                /*    -> */
  3974.     unsigned long                getBufferSize;            /*  -> */
  3975. };
  3976. #if defined(powerc) || defined(__powerc)
  3977. #pragma options align=reset
  3978. #endif
  3979.  
  3980. typedef struct DirGetRecordAccessControlGetPB DirGetRecordAccessControlGetPB;
  3981.  
  3982. /* The Access Control call-back function is defined as follows: */
  3983. typedef pascal Boolean (*ForEachRecordAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask activeRecordAccMask, AccessMask defaultAttributeAccMask);
  3984.  
  3985. enum {
  3986.     uppForEachRecordAccessControlProcInfo = kPascalStackBased
  3987.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  3988.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  3989.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  3990.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  3991.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  3992.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask)))
  3993. };
  3994.  
  3995. #if USESROUTINEDESCRIPTORS
  3996. typedef UniversalProcPtr ForEachRecordAccessControlUPP;
  3997.  
  3998. #define CallForEachRecordAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, defaultAttributeAccMask)        \
  3999.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachRecordAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (defaultAttributeAccMask))
  4000. #define NewForEachRecordAccessControlProc(userRoutine)        \
  4001.         (ForEachRecordAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachRecordAccessControlProcInfo, GetCurrentISA())
  4002. #else
  4003. typedef ForEachRecordAccessControlProcPtr ForEachRecordAccessControlUPP;
  4004.  
  4005. #define CallForEachRecordAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, defaultAttributeAccMask)        \
  4006.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (defaultAttributeAccMask))
  4007. #define NewForEachRecordAccessControlProc(userRoutine)        \
  4008.         (ForEachRecordAccessControlUPP)(userRoutine)
  4009. #endif
  4010.  
  4011. typedef ForEachRecordAccessControlUPP ForEachRecordAccessControl;
  4012.  
  4013. /*
  4014.     GetRecordAccessControlParse:
  4015.     After an GetRecordAccessControlGet call has completed, 
  4016.     call GetRecordAccessControlParse to parse through the buffer that
  4017.     that was filled in GetRecordAccessControlGet.
  4018.     
  4019.     'eachObject' will be called each time to return to the client a
  4020.     DsObject and a set of three accMasks (three long words) for that object.
  4021.     Acceesmasks returned apply to the dsObject in the callback :
  4022.     1. Active Access mask for the DNode Containing the Record.
  4023.     2. Active Access mask for the Record specified.
  4024.     3. Defualt Access mask for Attributes in the record.
  4025.     The clientData parameter that you pass in the parameter block will be passed
  4026.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  4027.     to allow you some way to match the call-back to the original call (for
  4028.     example, you make more then one aysynchronous GetRecordAccessControlGet calls and you want to
  4029.     associate returned results in some way).
  4030.     
  4031.     The client should return FALSE from 'eachObject' to continue
  4032.     processing of the GetRecordAccessControlParse request.  Returning TRUE will
  4033.     terminate the GetRecordAccessControlParse request.
  4034.  
  4035.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  4036.     of execution as the thread that made the GetRecordAccessControlParse call.  That means that the
  4037.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  4038.     that were in effect when the call was made.  Because of this, the call-back
  4039.     routine has the same restrictions as the caller of GetRecordAccessControlParse:
  4040.     if GetRecordAccessControlParse was not called from interrupt level, then the call-
  4041.     back routine can allocate memory. For asynchronous calls, call-back routine is
  4042.     like a ioCompletion except that A5 will be preserved for the application.
  4043.  
  4044.  
  4045. */
  4046.  
  4047. #if defined(powerc) || defined (__powerc)
  4048. #pragma options align=mac68k
  4049. #endif
  4050. struct DirGetRecordAccessControlParsePB {
  4051.     Ptr                            qLink;
  4052.     long                        reserved1;
  4053.     long                        reserved2;
  4054.     DirIOCompletionUPP            ioCompletion;
  4055.     OSErr                        ioResult;
  4056.     unsigned long                saveA5;
  4057.     short                        reqCode;
  4058.     long                        reserved[2];
  4059.     AddrBlock                    serverHint;
  4060.     short                        dsRefNum;
  4061.     unsigned long                callID;
  4062.     AuthIdentity                identity;
  4063.     long                        gReserved1;
  4064.     long                        gReserved2;
  4065.     long                        gReserved3;
  4066.     long                        clientData;
  4067.     RecordIDPtr                 aRecord;                /*  -> RecordID to which access control list is sought list is sought  */
  4068.     long                        bReserved;              /*  -- unused */
  4069.     long                        cReserved;              /*  -- unused */
  4070.     long                        dReserved;              /*  -- unused */
  4071.     ForEachRecordAccessControl    eachObject;              /* --> */
  4072.     Boolean                        forCurrentUserOnly;         /* -->  */
  4073.     DSSpec                        *startingPoint;         /* --> starting Point */
  4074.     Boolean                        includeStartingPoint;     /*  -> if true return the record specified in starting point */ 
  4075.     Ptr                            getBuffer;                /*    -> */
  4076.     unsigned long                getBufferSize;            /*  -> */
  4077. };
  4078. #if defined(powerc) || defined(__powerc)
  4079. #pragma options align=reset
  4080. #endif
  4081.  
  4082. typedef struct DirGetRecordAccessControlParsePB DirGetRecordAccessControlParsePB;
  4083.  
  4084. /*
  4085.     GetAttributeAccessControlGet:
  4086.     This call can be done to get back access control list for a attributeType with in a RecordID.
  4087.     aRecord -> RecordID to which access control list is sought
  4088.     aType    -> Attribute Type to which access controls are sought
  4089.     curUserAccMask -> If this is 'true', Access controls for the user specified by
  4090.                       the identity parameter will be returned other wise entire list
  4091.                       will be returned.
  4092.     startingDsObj  -> If this is not nil, list should be started after this object.
  4093.     startingPointInclusive -> If staringDsObj is specified, include that in the returned
  4094.                               results.
  4095.                               
  4096.     The results will be collected in the 'getBuffer' supplied by the user.
  4097.     If buffer can not hold all the data returned 'daMoreData' error will be returned.
  4098.      
  4099.     If user receives 'noErr' or 'daMoreData', buffer will contain valid results. A user
  4100.     can extract the results in the 'getBuffer' by making 'DsGetDNodeAccessControlParse' call.
  4101.     
  4102.     Results returned for each DSObject will contain DSSpecPtr and accMask. 
  4103.  
  4104. */
  4105.  
  4106. #if defined(powerc) || defined (__powerc)
  4107. #pragma options align=mac68k
  4108. #endif
  4109. struct DirGetAttributeAccessControlGetPB {
  4110.     Ptr                            qLink;
  4111.     long                        reserved1;
  4112.     long                        reserved2;
  4113.     DirIOCompletionUPP            ioCompletion;
  4114.     OSErr                        ioResult;
  4115.     unsigned long                saveA5;
  4116.     short                        reqCode;
  4117.     long                        reserved[2];
  4118.     AddrBlock                    serverHint;
  4119.     short                        dsRefNum;
  4120.     unsigned long                callID;
  4121.     AuthIdentity                identity;
  4122.     long                        gReserved1;
  4123.     long                        gReserved2;
  4124.     long                        gReserved3;
  4125.     long                        clientData;
  4126.     RecordIDPtr                    aRecord;
  4127.     AttributeTypePtr            aType;
  4128.     long                        cReserved;
  4129.     long                        dReserved;
  4130.     long                        eResreved;
  4131.     Boolean                        forCurrentUserOnly;
  4132.     DSSpec                        *startingPoint;
  4133.     Boolean                        includeStartingPoint;
  4134.     Ptr                            getBuffer;
  4135.     unsigned long                getBufferSize;
  4136. };
  4137. #if defined(powerc) || defined(__powerc)
  4138. #pragma options align=reset
  4139. #endif
  4140.  
  4141. typedef struct DirGetAttributeAccessControlGetPB DirGetAttributeAccessControlGetPB;
  4142.  
  4143. /* The Access Control call-back function is defined as follows: */
  4144. typedef pascal Boolean (*ForEachAttributeAccessControlProcPtr)(long clientData, const DSSpec *dsObj, AccessMask activeDnodeAccMask, AccessMask activeRecordAccMask, AccessMask activeAttributeAccMask);
  4145.  
  4146. enum {
  4147.     uppForEachAttributeAccessControlProcInfo = kPascalStackBased
  4148.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  4149.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  4150.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DSSpec*)))
  4151.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(AccessMask)))
  4152.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(AccessMask)))
  4153.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(AccessMask)))
  4154. };
  4155.  
  4156. #if USESROUTINEDESCRIPTORS
  4157. typedef UniversalProcPtr ForEachAttributeAccessControlUPP;
  4158.  
  4159. #define CallForEachAttributeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, activeAttributeAccMask)        \
  4160.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppForEachAttributeAccessControlProcInfo, (clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (activeAttributeAccMask))
  4161. #define NewForEachAttributeAccessControlProc(userRoutine)        \
  4162.         (ForEachAttributeAccessControlUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppForEachAttributeAccessControlProcInfo, GetCurrentISA())
  4163. #else
  4164. typedef ForEachAttributeAccessControlProcPtr ForEachAttributeAccessControlUPP;
  4165.  
  4166. #define CallForEachAttributeAccessControlProc(userRoutine, clientData, dsObj, activeDnodeAccMask, activeRecordAccMask, activeAttributeAccMask)        \
  4167.         (*(userRoutine))((clientData), (dsObj), (activeDnodeAccMask), (activeRecordAccMask), (activeAttributeAccMask))
  4168. #define NewForEachAttributeAccessControlProc(userRoutine)        \
  4169.         (ForEachAttributeAccessControlUPP)(userRoutine)
  4170. #endif
  4171.  
  4172. typedef ForEachAttributeAccessControlUPP ForEachAttributeAccessControl;
  4173.     
  4174. /*
  4175.     GetAttributeAccessControlParse:
  4176.     After an GetAttributeAccessControlGet call has completed, 
  4177.     call GetAttributeAccessControlParse to parse through the buffer that
  4178.     that was filled in GetAttributeAccessControlGet.
  4179.     
  4180.     'eachObject' will be called each time to return to the client a
  4181.     DsObject and a set of three accMasks (three long words) for that object.
  4182.     Acceesmasks returned apply to the dsObject in the callback :
  4183.     1. Active Access mask for the DNode Containing the Attribute.
  4184.     2. Active Access mask for the Record in the Containing the Attribute.
  4185.     3. Active Access mask for the specified Attribute.
  4186.     The clientData parameter that you pass in the parameter block will be passed
  4187.     to 'eachObject'.  You are free to put anything in clientData - it is intended
  4188.     to allow you some way to match the call-back to the original call (for
  4189.     example, you make more then one aysynchronous GetAttributeAccessControlGet calls and you want to
  4190.     associate returned results in some way).
  4191.     
  4192.     The client should return FALSE from 'eachObject' to continue
  4193.     processing of the GetAttributeAccessControlParse request.  Returning TRUE will
  4194.     terminate the GetAttributeAccessControlParse request.
  4195.  
  4196.     For synchronous calls, the call-back routine actually runs as part of the same thread 
  4197.     of execution as the thread that made the GetAttributeAccessControlParse call.  That means that the
  4198.     same low-memory globals, A5, stack, etc. are in effect during the call-back
  4199.     that were in effect when the call was made.  Because of this, the call-back
  4200.     routine has the same restrictions as the caller of GetAttributeAccessControlParse:
  4201.     if GetAttributeAccessControlParse was not called from interrupt level, then the call-
  4202.     back routine can allocate memory. For asynchronous calls, call-back routine is
  4203.     like a ioCompletion except that A5 will be preserved for the application.
  4204.  
  4205.  
  4206. */
  4207.  
  4208. #if defined(powerc) || defined (__powerc)
  4209. #pragma options align=mac68k
  4210. #endif
  4211. struct DirGetAttributeAccessControlParsePB {
  4212.     Ptr                                qLink;
  4213.     long                            reserved1;
  4214.     long                            reserved2;
  4215.     DirIOCompletionUPP                ioCompletion;
  4216.     OSErr                            ioResult;
  4217.     unsigned long                    saveA5;
  4218.     short                            reqCode;
  4219.     long                            reserved[2];
  4220.     AddrBlock                        serverHint;
  4221.     short                            dsRefNum;
  4222.     unsigned long                    callID;
  4223.     AuthIdentity                    identity;
  4224.     long                            gReserved1;
  4225.     long                            gReserved2;
  4226.     long                            gReserved3;
  4227.     long                            clientData;
  4228.     RecordIDPtr                        aRecord;                /*  -> RecordID to which access control list is sought list is sought  */
  4229.     AttributeTypePtr                aType;                    /*  -> Attribute Type to which access controls are sought          */
  4230.     long                            cReserved;              /*  -- unused */
  4231.     long                            dReserved;              /*  -- unused */
  4232.     ForEachAttributeAccessControl    eachObject;             /* --> */
  4233.     Boolean                            forCurrentUserOnly;         /* -->  */
  4234.     DSSpec                            *startingPoint;         /* --> starting Point */
  4235.     Boolean                            includeStartingPoint;     /*  -> if true return the record specified in starting point */ 
  4236.     Ptr                                getBuffer;                /*    -> */
  4237.     unsigned long                    getBufferSize;            /*  -> */
  4238. };
  4239. #if defined(powerc) || defined(__powerc)
  4240. #pragma options align=reset
  4241. #endif
  4242.  
  4243. typedef struct DirGetAttributeAccessControlParsePB DirGetAttributeAccessControlParsePB;
  4244.  
  4245. /*
  4246. MapPathNameToDNodeNumber:
  4247. This call maps a given PathName within a catalog to its DNodeNumber.
  4248. */
  4249.  
  4250. #if defined(powerc) || defined (__powerc)
  4251. #pragma options align=mac68k
  4252. #endif
  4253. struct DirMapPathNameToDNodeNumberPB {
  4254.     Ptr                            qLink;
  4255.     long                        reserved1;
  4256.     long                        reserved2;
  4257.     DirIOCompletionUPP            ioCompletion;
  4258.     OSErr                        ioResult;
  4259.     unsigned long                saveA5;
  4260.     short                        reqCode;
  4261.     long                        reserved[2];
  4262.     AddrBlock                    serverHint;
  4263.     short                        dsRefNum;
  4264.     unsigned long                callID;
  4265.     AuthIdentity                identity;
  4266.     long                        gReserved1;
  4267.     long                        gReserved2;
  4268.     long                        gReserved3;
  4269.     long                        clientData;
  4270.     DirectoryNamePtr            directoryName;    /*  --> catalog name */
  4271.     DirDiscriminator            discriminator;    /*  --> discriminator */
  4272.     DNodeNum                     dNodeNumber;    /* <--  dNodenumber to the path */
  4273.     PackedPathNamePtr            path;            /*  --> Path Name to be mapped */
  4274. };
  4275. #if defined(powerc) || defined(__powerc)
  4276. #pragma options align=reset
  4277. #endif
  4278.  
  4279. typedef struct DirMapPathNameToDNodeNumberPB DirMapPathNameToDNodeNumberPB;
  4280.  
  4281. /*
  4282. PathName in the path field will be mapped to the cooresponding dNodeNumber and
  4283. returned in the DNodeNumber field. directoryName and descriminator Fields are
  4284. ignored. DSRefNum is used to identify the catalog.
  4285. */
  4286.  
  4287.  
  4288.  
  4289. /*
  4290. MapDNodeNumberToPathName:
  4291. This call will map a given DNodeNumber with in a catalog to the
  4292. corresponding PathName.
  4293. */
  4294.  
  4295. #if defined(powerc) || defined (__powerc)
  4296. #pragma options align=mac68k
  4297. #endif
  4298. struct DirMapDNodeNumberToPathNamePB {
  4299.     Ptr                            qLink;
  4300.     long                        reserved1;
  4301.     long                        reserved2;
  4302.     DirIOCompletionUPP            ioCompletion;
  4303.     OSErr                        ioResult;
  4304.     unsigned long                saveA5;
  4305.     short                        reqCode;
  4306.     long                        reserved[2];
  4307.     AddrBlock                    serverHint;
  4308.     short                        dsRefNum;
  4309.     unsigned long                callID;
  4310.     AuthIdentity                identity;
  4311.     long                        gReserved1;
  4312.     long                        gReserved2;
  4313.     long                        gReserved3;
  4314.     long                        clientData;
  4315.     DirectoryNamePtr            directoryName;        /*  --> catalog name */
  4316.     DirDiscriminator            discriminator;        /*  --> discriminator */
  4317.     DNodeNum                    dNodeNumber;        /*  --> dNodenumber to be mapped */
  4318.     PackedPathNamePtr            path;                /* <--  Packed Path Name returned */
  4319.     unsigned short                lengthOfPathName;    /*  --> length of packed pathName structure*/
  4320. };
  4321. #if defined(powerc) || defined(__powerc)
  4322. #pragma options align=reset
  4323. #endif
  4324.  
  4325. typedef struct DirMapDNodeNumberToPathNamePB DirMapDNodeNumberToPathNamePB;
  4326.  
  4327. /*
  4328. dNodeNumber in the DNodeNumber field will be mapped to the cooresponding
  4329. pathName and returned in the PackedPathName field.
  4330. lengthOfPathName is to be set the length of pathName structure.
  4331. If length of PackedPathName is larger then the lengthOfPathName, kOCEMoreData
  4332. OSErr will be returned.
  4333. */
  4334.  
  4335. /*
  4336. GetLocalNetworkSpec:
  4337. This call will return the Local NetworkSpec. Client should supply
  4338. an RString big enough to hold the NetworkSpec.
  4339. */
  4340.  
  4341. #if defined(powerc) || defined (__powerc)
  4342. #pragma options align=mac68k
  4343. #endif
  4344. struct DirGetLocalNetworkSpecPB {
  4345.     Ptr                            qLink;
  4346.     long                        reserved1;
  4347.     long                        reserved2;
  4348.     DirIOCompletionUPP            ioCompletion;
  4349.     OSErr                        ioResult;
  4350.     unsigned long                saveA5;
  4351.     short                        reqCode;
  4352.     long                        reserved[2];
  4353.     AddrBlock                    serverHint;
  4354.     short                        dsRefNum;
  4355.     unsigned long                callID;
  4356.     AuthIdentity                identity;
  4357.     long                        gReserved1;
  4358.     long                        gReserved2;
  4359.     long                        gReserved3;
  4360.     long                        clientData;
  4361.     DirectoryNamePtr            directoryName;    /*  --> catalog name */
  4362.     DirDiscriminator            discriminator;    /*  --> discriminator */
  4363.     NetworkSpecPtr                networkSpec;    /* <--  NetworkSpec */
  4364. };
  4365. #if defined(powerc) || defined(__powerc)
  4366. #pragma options align=reset
  4367. #endif
  4368.  
  4369. typedef struct DirGetLocalNetworkSpecPB DirGetLocalNetworkSpecPB;
  4370.  
  4371. /*
  4372. PathName in the path field must be set to nil. internetName should be large
  4373. enough to hold the internetName. InterNetname returned indicates path finder's
  4374. local internet (configured by administrator).
  4375. */
  4376.  
  4377. /*
  4378. GetDNodeInfo:
  4379. This call will return the information (internetName and descriptor)
  4380. for the given RLI of a DNode.
  4381. */
  4382.  
  4383. #if defined(powerc) || defined (__powerc)
  4384. #pragma options align=mac68k
  4385. #endif
  4386. struct DirGetDNodeInfoPB {
  4387.     Ptr                            qLink;
  4388.     long                        reserved1;
  4389.     long                        reserved2;
  4390.     DirIOCompletionUPP            ioCompletion;
  4391.     OSErr                        ioResult;
  4392.     unsigned long                saveA5;
  4393.     short                        reqCode;
  4394.     long                        reserved[2];
  4395.     AddrBlock                    serverHint;
  4396.     short                        dsRefNum;
  4397.     unsigned long                callID;
  4398.     AuthIdentity                identity;
  4399.     long                        gReserved1;
  4400.     long                        gReserved2;
  4401.     long                        gReserved3;
  4402.     long                        clientData;
  4403.     PackedRLIPtr                pRLI;            /*  --> packed RLI whose info is requested */
  4404.     DirNodeKind                    descriptor;        /* <--  dNode descriptor */
  4405.     NetworkSpecPtr                networkSpec;    /* <--  cluster's networkSpec if kIsCluster */
  4406. };
  4407. #if defined(powerc) || defined(__powerc)
  4408. #pragma options align=reset
  4409. #endif
  4410.  
  4411. typedef struct DirGetDNodeInfoPB DirGetDNodeInfoPB;
  4412.  
  4413. /*
  4414. If DnodeNumber is set to a non zero value, path should be set to nil.
  4415. if DnodeNumber is set to zero, pathName should point to a packed path name.
  4416. internetName should be large enough to hold
  4417. the internetName. (If the internetName is same as the one got by
  4418. GetLocalInternetName call, it indicates cluster is reachable  without
  4419. forwarders, --> Tell me if I am wrong)
  4420. */
  4421.  
  4422.  
  4423. /*
  4424. DirCreatePersonalDirectory:
  4425. A new  personal catalog can be created by specifying an FSSpec for
  4426. the file. If a file already exists dupFNErr will be returned. This call is
  4427. supported 'synchronous' mode only.
  4428. */
  4429.  
  4430. #if defined(powerc) || defined (__powerc)
  4431. #pragma options align=mac68k
  4432. #endif
  4433. struct DirCreatePersonalDirectoryPB {
  4434.     Ptr                            qLink;
  4435.     long                        reserved1;
  4436.     long                        reserved2;
  4437.     DirIOCompletionUPP            ioCompletion;
  4438.     OSErr                        ioResult;
  4439.     unsigned long                saveA5;
  4440.     short                        reqCode;
  4441.     long                        reserved[2];
  4442.     AddrBlock                    serverHint;
  4443.     short                        dsRefNum;
  4444.     unsigned long                callID;
  4445.     AuthIdentity                identity;
  4446.     long                        gReserved1;
  4447.     long                        gReserved2;
  4448.     long                        gReserved3;
  4449.     long                        clientData;
  4450.     FSSpecPtr                    fsSpec;            /*  --> FSSpec for the Personal Catalog */
  4451.     OSType                        fdType;            /*  --> file type for the Personal Catalog */
  4452.     OSType                        fdCreator;        /*  --> file creator for the Personal Catalog */
  4453. };
  4454. #if defined(powerc) || defined(__powerc)
  4455. #pragma options align=reset
  4456. #endif
  4457.  
  4458. typedef struct DirCreatePersonalDirectoryPB DirCreatePersonalDirectoryPB;
  4459.  
  4460. /*
  4461. DirOpenPersonalDirectory:
  4462. An existing personal catalog can be opened using this call.
  4463. User can specify the personal catalog by FSSpec for the AddressBook file.
  4464. 'accessRequested' field specifies open permissions. 'fsRdPerm'  & 'fsRdWrPerm'
  4465. are the only accepted open modes for the address book.
  4466. When the call completes successfully, a dsRefNum will be returned. The 'dsRefNum'
  4467. field is in the DSParamBlockHeader. In addittion 'accessGranted' indicates
  4468. actual permission with personal catalog is opened and 'features' indicate the capabilty flags
  4469. associated with the personal catalog.
  4470. This call is supported 'synchronous' mode only.
  4471. */
  4472.  
  4473. #if defined(powerc) || defined (__powerc)
  4474. #pragma options align=mac68k
  4475. #endif
  4476. struct DirOpenPersonalDirectoryPB {
  4477.     Ptr                            qLink;
  4478.     long                        reserved1;
  4479.     long                        reserved2;
  4480.     DirIOCompletionUPP            ioCompletion;
  4481.     OSErr                        ioResult;
  4482.     unsigned long                saveA5;
  4483.     short                        reqCode;
  4484.     long                        reserved[2];
  4485.     AddrBlock                    serverHint;
  4486.     short                        dsRefNum;
  4487.     unsigned long                callID;
  4488.     AuthIdentity                identity;
  4489.     long                        gReserved1;
  4490.     long                        gReserved2;
  4491.     long                        gReserved3;
  4492.     long                        clientData;
  4493.     FSSpecPtr                    fsSpec;                /*  --> Open an existing Personal Catalog */
  4494.     char                        accessRequested;    /*  --> Open: permissions Requested(byte)*/
  4495.     char                        accessGranted;        /*  <-- Open: permissions (byte) (Granted)*/
  4496.     DirGestalt                    features;            /* <--  features for Personal Catalog */
  4497. };
  4498. #if defined(powerc) || defined(__powerc)
  4499. #pragma options align=reset
  4500. #endif
  4501.  
  4502. typedef struct DirOpenPersonalDirectoryPB DirOpenPersonalDirectoryPB;
  4503.  
  4504. /*
  4505. DirClosePersonalDirectory: This call lets a client close AddressBook opened by DirOpenPersonalDirectory.
  4506. The Personal Catalog specified by the 'dsRefNum' will be closed.
  4507. This call is supported 'synchronous' mode only.
  4508. */
  4509.  
  4510. #if defined(powerc) || defined (__powerc)
  4511. #pragma options align=mac68k
  4512. #endif
  4513. struct DirClosePersonalDirectoryPB {
  4514.     Ptr                            qLink;
  4515.     long                        reserved1;
  4516.     long                        reserved2;
  4517.     DirIOCompletionUPP            ioCompletion;
  4518.     OSErr                        ioResult;
  4519.     unsigned long                saveA5;
  4520.     short                        reqCode;
  4521.     long                        reserved[2];
  4522.     AddrBlock                    serverHint;
  4523.     short                        dsRefNum;
  4524.     unsigned long                callID;
  4525.     AuthIdentity                identity;
  4526.     long                        gReserved1;
  4527.     long                        gReserved2;
  4528.     long                        gReserved3;
  4529.     long                        clientData;
  4530. };
  4531. #if defined(powerc) || defined(__powerc)
  4532. #pragma options align=reset
  4533. #endif
  4534.  
  4535. typedef struct DirClosePersonalDirectoryPB DirClosePersonalDirectoryPB;
  4536.  
  4537. /*
  4538. DirMakePersonalDirectoryRLI: With this call a client can make an RLI
  4539. for a Personal Catalog opened by DirOpenPersonalDirectory Call.
  4540. A packed RLI is created for the Personal Catalog specified by the 'dsRefNum'.
  4541. If a client has a need to make the AddressBook reference to persistent
  4542. acrross boots it should make use of this call. In the current implementaion
  4543. PackedRLI has an embeeded System7.0 'alias'. If in later time
  4544. If client has a need to make reference to the AddressBook, it must use
  4545. ADAPLibrary call 'DUExtractAlias' and resole the 'alias' to 'FSSpec' and
  4546. make DirOpenPersonalDirectory call to get a 'dsRefNum'.
  4547.   'fromFSSpec'            FSPecPtr from which relative alias to be created. If nil,
  4548.                         absolute alias is created.
  4549.  'pRLIBufferSize' indicates the size of buffer pointed by 'pRLI'
  4550.  'pRLISize'    indicates the actual length of 'pRLI'. If the call
  4551.                         fails with 'kOCEMoreData' error a client can reissue
  4552.                     this call with a larger buffer of this length.
  4553.   'pRLI' is pointer to the buffer in which 'PackedRLI' is
  4554.   returned.
  4555. This call is supported in 'synchronous' mode only.
  4556. */
  4557.  
  4558. #if defined(powerc) || defined (__powerc)
  4559. #pragma options align=mac68k
  4560. #endif
  4561. struct DirMakePersonalDirectoryRLIPB {
  4562.     Ptr                            qLink;
  4563.     long                        reserved1;
  4564.     long                        reserved2;
  4565.     DirIOCompletionUPP            ioCompletion;
  4566.     OSErr                        ioResult;
  4567.     unsigned long                saveA5;
  4568.     short                        reqCode;
  4569.     long                        reserved[2];
  4570.     AddrBlock                    serverHint;
  4571.     short                        dsRefNum;
  4572.     unsigned long                callID;
  4573.     AuthIdentity                identity;
  4574.     long                        gReserved1;
  4575.     long                        gReserved2;
  4576.     long                        gReserved3;
  4577.     long                        clientData;
  4578.     FSSpecPtr                    fromFSSpec;        /*  --> FSSpec for creating relative alia */
  4579.     unsigned short                pRLIBufferSize;    /*  --> Length of 'pRLI' buffer */
  4580.     unsigned short                pRLISize;        /* <--  Length of actual 'pRLI' */
  4581.     PackedRLIPtr                pRLI;            /* <--  pRLI for the specified AddressBook */
  4582. };
  4583. #if defined(powerc) || defined(__powerc)
  4584. #pragma options align=reset
  4585. #endif
  4586.  
  4587. typedef struct DirMakePersonalDirectoryRLIPB DirMakePersonalDirectoryRLIPB;
  4588.  
  4589. /*****************************************************************************
  4590. The calls described below apply only for CSAM Drivers:
  4591.  
  4592. The following three calls provide capability to Install/Remove a CSAM at RunTime.
  4593.     DirAddDSAM
  4594.     DirRemoveDSAM
  4595.     DirInstantiateDSAM
  4596.  
  4597. The following two calls provide capability to Install/Remove a CSAM Catalog at RunTime.
  4598.     DirAddDSAMDirectory
  4599.     DirRemoveDirectory
  4600.  
  4601. DirGetDirectoryIcon call is used by clients to get any special icon associated
  4602. with a CSAM catalog.
  4603.  
  4604. *****************************************************************************/
  4605.  
  4606.  
  4607. /*
  4608. DirAddDSAM: This call can be used to inorm the availability of a CSAM file
  4609. after discovering the CSAM file.
  4610.     dsamName -> is generic CSAM name e.g. Untitled X.500 directory
  4611.     dsamSignature -> could be generic CSAM kind e.g. 'X500'.
  4612.     fsSpec -> is the FileSpec for the file containing CSAM resources.
  4613. If the call is successfull 'DSAMRecordCID' will be returned. If the
  4614. call returns 'daDSAMRecordCIDExists', record was already there and
  4615. 'dsamRecordCID' will be returned.
  4616. This call can be done only in synchronous mode.
  4617. */
  4618.  
  4619. #if defined(powerc) || defined (__powerc)
  4620. #pragma options align=mac68k
  4621. #endif
  4622. struct DirAddDSAMPB {
  4623.     Ptr                            qLink;
  4624.     long                        reserved1;
  4625.     long                        reserved2;
  4626.     DirIOCompletionUPP            ioCompletion;
  4627.     OSErr                        ioResult;
  4628.     unsigned long                saveA5;
  4629.     short                        reqCode;
  4630.     long                        reserved[2];
  4631.     AddrBlock                    serverHint;
  4632.     short                        dsRefNum;
  4633.     unsigned long                callID;
  4634.     AuthIdentity                identity;
  4635.     long                        gReserved1;
  4636.     long                        gReserved2;
  4637.     long                        gReserved3;
  4638.     long                        clientData;
  4639.     CreationID                    dsamRecordCID;    /* <--  CreationID for the CSAM record */
  4640.     RStringPtr                    dsamName;        /*  --> CSAM name */
  4641.     OCEDirectoryKind            dsamKind;        /*  --> CSAM kind */
  4642.     FSSpecPtr                    fsSpec;            /*  --> FSSpec for the file containing CSAM */
  4643. };
  4644. #if defined(powerc) || defined(__powerc)
  4645. #pragma options align=reset
  4646. #endif
  4647.  
  4648. typedef struct DirAddDSAMPB DirAddDSAMPB;
  4649.  
  4650. typedef pascal OSErr (*DSAMDirProcPtr)(Ptr dsamData, DirParamBlockPtr paramBlock, Boolean async);
  4651.  
  4652. enum {
  4653.     uppDSAMDirProcInfo = kPascalStackBased
  4654.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4655.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4656.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirParamBlockPtr)))
  4657.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  4658. };
  4659.  
  4660. #if USESROUTINEDESCRIPTORS
  4661. typedef UniversalProcPtr DSAMDirUPP;
  4662.  
  4663. #define CallDSAMDirProc(userRoutine, dsamData, paramBlock, async)        \
  4664.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMDirProcInfo, (dsamData), (paramBlock), (async))
  4665. #define NewDSAMDirProc(userRoutine)        \
  4666.         (DSAMDirUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMDirProcInfo, GetCurrentISA())
  4667. #else
  4668. typedef DSAMDirProcPtr DSAMDirUPP;
  4669.  
  4670. #define CallDSAMDirProc(userRoutine, dsamData, paramBlock, async)        \
  4671.         (*(userRoutine))((dsamData), (paramBlock), (async))
  4672. #define NewDSAMDirProc(userRoutine)        \
  4673.         (DSAMDirUPP)(userRoutine)
  4674. #endif
  4675.  
  4676. typedef pascal OSErr (*DSAMDirParseProcPtr)(Ptr dsamData, DirParamBlockPtr paramBlock, Boolean async);
  4677.  
  4678. enum {
  4679.     uppDSAMDirParseProcInfo = kPascalStackBased
  4680.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4681.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4682.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(DirParamBlockPtr)))
  4683.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  4684. };
  4685.  
  4686. #if USESROUTINEDESCRIPTORS
  4687. typedef UniversalProcPtr DSAMDirParseUPP;
  4688.  
  4689. #define CallDSAMDirParseProc(userRoutine, dsamData, paramBlock, async)        \
  4690.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMDirParseProcInfo, (dsamData), (paramBlock), (async))
  4691. #define NewDSAMDirParseProc(userRoutine)        \
  4692.         (DSAMDirParseUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMDirParseProcInfo, GetCurrentISA())
  4693. #else
  4694. typedef DSAMDirParseProcPtr DSAMDirParseUPP;
  4695.  
  4696. #define CallDSAMDirParseProc(userRoutine, dsamData, paramBlock, async)        \
  4697.         (*(userRoutine))((dsamData), (paramBlock), (async))
  4698. #define NewDSAMDirParseProc(userRoutine)        \
  4699.         (DSAMDirParseUPP)(userRoutine)
  4700. #endif
  4701.  
  4702. typedef pascal OSErr (*DSAMAuthProcPtr)(Ptr dsamData, AuthParamBlockPtr pb, Boolean async);
  4703.  
  4704. enum {
  4705.     uppDSAMAuthProcInfo = kPascalStackBased
  4706.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  4707.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  4708.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(AuthParamBlockPtr)))
  4709.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  4710. };
  4711.  
  4712. #if USESROUTINEDESCRIPTORS
  4713. typedef UniversalProcPtr DSAMAuthUPP;
  4714.  
  4715. #define CallDSAMAuthProc(userRoutine, dsamData, pb, async)        \
  4716.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSAMAuthProcInfo, (dsamData), (pb), (async))
  4717. #define NewDSAMAuthProc(userRoutine)        \
  4718.         (DSAMAuthUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSAMAuthProcInfo, GetCurrentISA())
  4719. #else
  4720. typedef DSAMAuthProcPtr DSAMAuthUPP;
  4721.  
  4722. #define CallDSAMAuthProc(userRoutine, dsamData, pb, async)        \
  4723.         (*(userRoutine))((dsamData), (pb), (async))
  4724. #define NewDSAMAuthProc(userRoutine)        \
  4725.         (DSAMAuthUPP)(userRoutine)
  4726. #endif
  4727.  
  4728. typedef DSAMDirUPP DSAMDirProc;
  4729. typedef DSAMDirParseUPP DSAMDirParseProc;
  4730. typedef DSAMAuthUPP DSAMAuthProc;
  4731.  
  4732.  
  4733. /*
  4734. DirInstantiateDSAM: This call should be used by the CSAM driver in response
  4735. Driver Open call to indicate the toolbox about the availability of the CSAM.
  4736.     dsamName -> is generic CSAM name e.g. Untitled X.500 directory
  4737.     dsamKind -> could be generic CSAM kind e.g. 'X500'.
  4738.     dsamData -> pointer to private DSAMData. This will be paased back to the CSAM
  4739.     when the CSAM functions (DSAMDirProc,DSAMDirParseProc, DSAMAuthProc) are called.
  4740.     CSAM should already be setup using DirAddDSAM call.
  4741.     DSAMDirProc -> This procedure will be called when  any catalog service
  4742.     call intended for the CSAM (other then parse calls)
  4743.     DSAMDirParseProc -> This procedure will be called when any of the parse calls
  4744.     are called.
  4745.     DSAMAuthProc -> This procedure will be called when any of the Authentication Calls
  4746.     are made to the CSAM. If the CSAM does not support authentication, this can be nil.
  4747. This call can be done only in synchronous mode.
  4748. */
  4749.  
  4750. #if defined(powerc) || defined (__powerc)
  4751. #pragma options align=mac68k
  4752. #endif
  4753. struct DirInstantiateDSAMPB {
  4754.     Ptr                            qLink;
  4755.     long                        reserved1;
  4756.     long                        reserved2;
  4757.     DirIOCompletionUPP            ioCompletion;
  4758.     OSErr                        ioResult;
  4759.     unsigned long                saveA5;
  4760.     short                        reqCode;
  4761.     long                        reserved[2];
  4762.     AddrBlock                    serverHint;
  4763.     short                        dsRefNum;
  4764.     unsigned long                callID;
  4765.     AuthIdentity                identity;
  4766.     long                        gReserved1;
  4767.     long                        gReserved2;
  4768.     long                        gReserved3;
  4769.     long                        clientData;
  4770.     RStringPtr                    dsamName;            /*  --> dsamName name */
  4771.     OCEDirectoryKind            dsamKind;            /*  --> DSAMKind */
  4772.     Ptr                            dsamData;            /*  --> dsamData  */
  4773.     DSAMDirUPP                    dsamDirProc;        /*  --> of type DSAMDirProc: for catalog service calls */
  4774.     DSAMDirParseUPP                dsamDirParseProc;    /*  --> of type DSAMDirParseProc: for catalog service parse calls */
  4775.     DSAMAuthUPP                    dsamAuthProc;        /*  --> of type DSAMAuthProc: for authetication service calls */
  4776. };
  4777. #if defined(powerc) || defined(__powerc)
  4778. #pragma options align=reset
  4779. #endif
  4780.  
  4781. typedef struct DirInstantiateDSAMPB DirInstantiateDSAMPB;
  4782.  
  4783. /*
  4784. DirRemoveDSAM: This call can be used to remove  a CSAM file from the OCE Setup.
  4785.     dsamRecordCID -> is the creationID of the CSAM record.
  4786. This call can be made only in synchronous mode.
  4787. */
  4788.  
  4789. #if defined(powerc) || defined (__powerc)
  4790. #pragma options align=mac68k
  4791. #endif
  4792. struct DirRemoveDSAMPB {
  4793.     Ptr                            qLink;
  4794.     long                        reserved1;
  4795.     long                        reserved2;
  4796.     DirIOCompletionUPP            ioCompletion;
  4797.     OSErr                        ioResult;
  4798.     unsigned long                saveA5;
  4799.     short                        reqCode;
  4800.     long                        reserved[2];
  4801.     AddrBlock                    serverHint;
  4802.     short                        dsRefNum;
  4803.     unsigned long                callID;
  4804.     AuthIdentity                identity;
  4805.     long                        gReserved1;
  4806.     long                        gReserved2;
  4807.     long                        gReserved3;
  4808.     long                        clientData;
  4809.     CreationID                    dsamRecordCID;
  4810. };
  4811. #if defined(powerc) || defined(__powerc)
  4812. #pragma options align=reset
  4813. #endif
  4814.  
  4815. typedef struct DirRemoveDSAMPB DirRemoveDSAMPB;
  4816.  
  4817. /*
  4818. DirAddDSAMDirectory: This call can be used to inorm the availability of a CSAM catalog.
  4819.     dsamRecordCID ->  recordID for the CSAM serving this catalog
  4820.     directoryName ->  name of the catalog
  4821.     discriminator -> discriminator for the catalog
  4822.     directoryRecordCID -> If the call is successful, creationID for the record will
  4823.                             be returned.
  4824. */
  4825.  
  4826. #if defined(powerc) || defined (__powerc)
  4827. #pragma options align=mac68k
  4828. #endif
  4829. struct DirAddDSAMDirectoryPB {
  4830.     Ptr                            qLink;
  4831.     long                        reserved1;
  4832.     long                        reserved2;
  4833.     DirIOCompletionUPP            ioCompletion;
  4834.     OSErr                        ioResult;
  4835.     unsigned long                saveA5;
  4836.     short                        reqCode;
  4837.     long                        reserved[2];
  4838.     AddrBlock                    serverHint;
  4839.     short                        dsRefNum;
  4840.     unsigned long                callID;
  4841.     AuthIdentity                identity;
  4842.     long                        gReserved1;
  4843.     long                        gReserved2;
  4844.     long                        gReserved3;
  4845.     long                        clientData;
  4846.     CreationID                    dsamRecordCID;            /*  --> CreationID for the CSAM record */
  4847.     DirectoryNamePtr            directoryName;            /*  --> catalog name */
  4848.     DirDiscriminator            discriminator;            /*  --> catalog discriminator */
  4849.     DirGestalt                    features;                /*  --> capabilty flags for the catalog */
  4850.     CreationID                    directoryRecordCID;        /* <--  creationID for the catalog record */
  4851. };
  4852. #if defined(powerc) || defined(__powerc)
  4853. #pragma options align=reset
  4854. #endif
  4855.  
  4856. typedef struct DirAddDSAMDirectoryPB DirAddDSAMDirectoryPB;
  4857.  
  4858. /*
  4859. DirRemoveDirectory: This call can be used to inform the toolbox that
  4860. catalog specified by 'directoryRecordCID'
  4861. */
  4862.  
  4863. #if defined(powerc) || defined (__powerc)
  4864. #pragma options align=mac68k
  4865. #endif
  4866. struct DirRemoveDirectoryPB {
  4867.     Ptr                            qLink;
  4868.     long                        reserved1;
  4869.     long                        reserved2;
  4870.     DirIOCompletionUPP            ioCompletion;
  4871.     OSErr                        ioResult;
  4872.     unsigned long                saveA5;
  4873.     short                        reqCode;
  4874.     long                        reserved[2];
  4875.     AddrBlock                    serverHint;
  4876.     short                        dsRefNum;
  4877.     unsigned long                callID;
  4878.     AuthIdentity                identity;
  4879.     long                        gReserved1;
  4880.     long                        gReserved2;
  4881.     long                        gReserved3;
  4882.     long                        clientData;
  4883.     CreationID                    directoryRecordCID;
  4884. };
  4885. #if defined(powerc) || defined(__powerc)
  4886. #pragma options align=reset
  4887. #endif
  4888.  
  4889. typedef struct DirRemoveDirectoryPB DirRemoveDirectoryPB;
  4890.  
  4891. /*
  4892.  * DSGetExtendedDirectoriesInfo::  This call can be used to get
  4893.  * the information of various foreign catalogs supported.
  4894.  * Typically a DE Template  may make this call to create a
  4895.  * Address template or a Gateway may make this call to findout
  4896.  * catalog name space in which MSAM may would support. 
  4897.  * Client will supply a buffer pointed by 'bufferPtr' of size 'bufferLength'. 
  4898.  * When the call completes with 'daMoreData' error, client can examine 'totalEntries'
  4899.  * returned and reissue the call with increaing buffer.
  4900.  * Toolbox will findout the private information of each of the Foreign Catalogs
  4901.  * by polling CSAM's, Gateways, and MnMServers. The Information returned
  4902.  * for each catalog will be packed in the format: 
  4903.  * typedef struct EachDirectoryData {
  4904.  *  PackedRLI                        pRLI;           //  packed RLI for the catalog
  4905.  *  OSType                            entnType;        //  Entn Type
  4906.  *  long                            hasMailSlot;   //  If this catalog has mail slot this will be 1 otherwise zero
  4907.  *    ProtoRString                    RealName;      //  Packed RString for Real Name (padded to even boundary) 
  4908.  *    ProtoRString                    comment;       //  Packed RString holding any comment for Display (padded to even boundary)
  4909.  *    long                            length;        //  data length
  4910.  *    char                            data[length];  //  data padded to even boundary
  4911.  * };
  4912.  *
  4913.  *
  4914.  *
  4915.  * typedef struct myData {
  4916.  *      EachDirectoryData    data[numberOfEntries];    // data packed in the above format
  4917.  *    };
  4918.  *
  4919.  */
  4920.  
  4921. #if defined(powerc) || defined (__powerc)
  4922. #pragma options align=mac68k
  4923. #endif
  4924. struct DirGetExtendedDirectoriesInfoPB {
  4925.     Ptr                            qLink;
  4926.     long                        reserved1;
  4927.     long                        reserved2;
  4928.     DirIOCompletionUPP            ioCompletion;
  4929.     OSErr                        ioResult;
  4930.     unsigned long                saveA5;
  4931.     short                        reqCode;
  4932.     long                        reserved[2];
  4933.     AddrBlock                    serverHint;
  4934.     short                        dsRefNum;
  4935.     unsigned long                callID;
  4936.     AuthIdentity                identity;
  4937.     long                        gReserved1;
  4938.     long                        gReserved2;
  4939.     long                        gReserved3;
  4940.     long                        clientData;
  4941.     Ptr                            buffer;            /*  --> Pointer to a buufer where data will be returned */
  4942.     unsigned long                bufferSize;        /*  --> Length of the buffer, Length of actual data will be returned here */
  4943.     unsigned long                totalEntries;    /* <--  Total Number of Catalogs found */
  4944.     unsigned long                actualEntries;    /* <--  Total Number of Catalogs entries returned */
  4945. };
  4946. #if defined(powerc) || defined(__powerc)
  4947. #pragma options align=reset
  4948. #endif
  4949.  
  4950. typedef struct DirGetExtendedDirectoriesInfoPB DirGetExtendedDirectoriesInfoPB;
  4951.  
  4952. /*
  4953. DirGetDirectoryIconPB: With this call a client can find out about
  4954. the icons supported by the Catalog.
  4955. Both ADAP and Personal Catalog will not support this call for now.
  4956. A CSAM can support a call so that DE Extension can use this
  4957. call to find appropriate Icons.
  4958.  
  4959. Returns kOCEBufferTooSmall if icon is too small, but will update iconSize.
  4960. */
  4961.  
  4962. #if defined(powerc) || defined (__powerc)
  4963. #pragma options align=mac68k
  4964. #endif
  4965. struct DirGetDirectoryIconPB {
  4966.     Ptr                            qLink;
  4967.     long                        reserved1;
  4968.     long                        reserved2;
  4969.     DirIOCompletionUPP            ioCompletion;
  4970.     OSErr                        ioResult;
  4971.     unsigned long                saveA5;
  4972.     short                        reqCode;
  4973.     long                        reserved[2];
  4974.     AddrBlock                    serverHint;
  4975.     short                        dsRefNum;
  4976.     unsigned long                callID;
  4977.     AuthIdentity                identity;
  4978.     long                        gReserved1;
  4979.     long                        gReserved2;
  4980.     long                        gReserved3;
  4981.     long                        clientData;
  4982.     PackedRLIPtr                pRLI;
  4983.     OSType                        iconType;
  4984.     Ptr                            iconBuffer;
  4985.     unsigned long                bufferSize;
  4986. };
  4987. #if defined(powerc) || defined(__powerc)
  4988. #pragma options align=reset
  4989. #endif
  4990.  
  4991. typedef struct DirGetDirectoryIconPB DirGetDirectoryIconPB;
  4992.  
  4993. /*
  4994. DirGetOCESetupRefNum: This call will return 'dsRefnum' for the OCE Setup Personal Catalog
  4995. and oceSetupRecordCID for the oceSetup Record.
  4996. Clients interested in manipulating OCE Setup Personal Catalog directly should
  4997. make this call to get 'dsRefNum'.
  4998. 'dsRefNum' will be returned in the standard field in the AuthDirParamHeader.
  4999. */
  5000.  
  5001. #if defined(powerc) || defined (__powerc)
  5002. #pragma options align=mac68k
  5003. #endif
  5004. struct DirGetOCESetupRefNumPB {
  5005.     Ptr                            qLink;
  5006.     long                        reserved1;
  5007.     long                        reserved2;
  5008.     DirIOCompletionUPP            ioCompletion;
  5009.     OSErr                        ioResult;
  5010.     unsigned long                saveA5;
  5011.     short                        reqCode;
  5012.     long                        reserved[2];
  5013.     AddrBlock                    serverHint;
  5014.     short                        dsRefNum;
  5015.     unsigned long                callID;
  5016.     AuthIdentity                identity;
  5017.     long                        gReserved1;
  5018.     long                        gReserved2;
  5019.     long                        gReserved3;
  5020.     long                        clientData;
  5021.     CreationID                    oceSetupRecordCID;
  5022. };
  5023. #if defined(powerc) || defined(__powerc)
  5024. #pragma options align=reset
  5025. #endif
  5026.  
  5027. typedef struct DirGetOCESetupRefNumPB DirGetOCESetupRefNumPB;
  5028.  
  5029. /*****************************************************************************/
  5030. /* Catalog and Authentication control blocks and operation definitions */
  5031.  
  5032. #if defined(powerc) || defined (__powerc)
  5033. #pragma options align=mac68k
  5034. #endif
  5035. union AuthParamBlock {
  5036.     struct {
  5037.         Ptr                            qLink;
  5038.         long                        reserved1;
  5039.         long                        reserved2;
  5040.         DirIOCompletionUPP            ioCompletion;
  5041.         OSErr                        ioResult;
  5042.         unsigned long                saveA5;
  5043.         short                        reqCode;
  5044.         long                        reserved[2];
  5045.         AddrBlock                    serverHint;
  5046.         short                        dsRefNum;
  5047.         unsigned long                callID;
  5048.         AuthIdentity                identity;
  5049.         long                        gReserved1;
  5050.         long                        gReserved2;
  5051.         long                        gReserved3;
  5052.         long                        clientData;
  5053.     }                            header;
  5054.     AuthBindSpecificIdentityPB    bindIdentityPB;
  5055.     AuthUnbindSpecificIdentityPB unbindIdentityPB;
  5056.     AuthResolveCreationIDPB        resolveCreationIDPB;
  5057.     AuthGetSpecificIdentityInfoPB getIdentityInfoPB;
  5058.     AuthAddKeyPB                addKeyPB;
  5059.     AuthChangeKeyPB                changeKeyPB;
  5060.     AuthDeleteKeyPB                deleteKeyPB;
  5061.     AuthPasswordToKeyPB            passwordToKeyPB;
  5062.     AuthGetCredentialsPB        getCredentialsPB;
  5063.     AuthDecryptCredentialsPB    decryptCredentialsPB;
  5064.     AuthMakeChallengePB            makeChallengePB;
  5065.     AuthMakeReplyPB                makeReplyPB;
  5066.     AuthVerifyReplyPB            verifyReplyPB;
  5067.     AuthGetUTCTimePB            getUTCTimePB;
  5068.     AuthMakeProxyPB                makeProxyPB;
  5069.     AuthTradeProxyForCredentialsPB tradeProxyForCredentialsPB;
  5070.     AuthGetLocalIdentityPB        getLocalIdentityPB;
  5071.     AuthUnlockLocalIdentityPB    unLockLocalIdentityPB;
  5072.     AuthLockLocalIdentityPB        lockLocalIdentityPB;
  5073.     AuthAddToLocalIdentityQueuePB localIdentityQInstallPB;
  5074.     AuthRemoveFromLocalIdentityQueuePB localIdentityQRemovePB;
  5075.     AuthSetupLocalIdentityPB    setupLocalIdentityPB;
  5076.     AuthChangeLocalIdentityPB    changeLocalIdentityPB;
  5077.     AuthRemoveLocalIdentityPB    removeLocalIdentityPB;
  5078.     OCESetupAddDirectoryInfoPB    setupDirectoryIdentityPB;
  5079.     OCESetupChangeDirectoryInfoPB changeDirectoryIdentityPB;
  5080.     OCESetupRemoveDirectoryInfoPB removeDirectoryIdentityPB;
  5081.     OCESetupGetDirectoryInfoPB    getDirectoryIdentityInfoPB;
  5082. };
  5083. #if defined(powerc) || defined(__powerc)
  5084. #pragma options align=reset
  5085. #endif
  5086.  
  5087.  
  5088. #if defined(powerc) || defined (__powerc)
  5089. #pragma options align=mac68k
  5090. #endif
  5091. union DirParamBlock {
  5092.     struct {
  5093.         Ptr                            qLink;
  5094.         long                        reserved1;
  5095.         long                        reserved2;
  5096.         DirIOCompletionUPP            ioCompletion;
  5097.         OSErr                        ioResult;
  5098.         unsigned long                saveA5;
  5099.         short                        reqCode;
  5100.         long                        reserved[2];
  5101.         AddrBlock                    serverHint;
  5102.         short                        dsRefNum;
  5103.         unsigned long                callID;
  5104.         AuthIdentity                identity;
  5105.         long                        gReserved1;
  5106.         long                        gReserved2;
  5107.         long                        gReserved3;
  5108.         long                        clientData;
  5109.     }                                    header;
  5110.  
  5111.     DirAddRecordPB                        addRecordPB;
  5112.     DirDeleteRecordPB                    deleteRecordPB;
  5113.     DirEnumerateGetPB                    enumerateGetPB;
  5114.     DirEnumerateParsePB                    enumerateParsePB;
  5115.     DirFindRecordGetPB                    findRecordGetPB;
  5116.     DirFindRecordParsePB                findRecordParsePB;
  5117.     DirLookupGetPB                        lookupGetPB;
  5118.     DirLookupParsePB                    lookupParsePB;
  5119.     DirAddAttributeValuePB                addAttributeValuePB;
  5120.     DirDeleteAttributeTypePB            deleteAttributeTypePB;
  5121.     DirDeleteAttributeValuePB            deleteAttributeValuePB;
  5122.     DirChangeAttributeValuePB            changeAttributeValuePB;
  5123.     DirVerifyAttributeValuePB            verifyAttributeValuePB;
  5124.     DirFindValuePB                        findValuePB;
  5125.     DirEnumeratePseudonymGetPB            enumeratePseudonymGetPB;
  5126.     DirEnumeratePseudonymParsePB         enumeratePseudonymParsePB;
  5127.     DirAddPseudonymPB                    addPseudonymPB;
  5128.     DirDeletePseudonymPB                deletePseudonymPB;
  5129.     DirAddAliasPB                        addAliasPB;
  5130.     DirEnumerateAttributeTypesGetPB     enumerateAttributeTypesGetPB;
  5131.     DirEnumerateAttributeTypesParsePB     enumerateAttributeTypesParsePB;
  5132.     DirGetNameAndTypePB                    getNameAndTypePB;
  5133.     DirSetNameAndTypePB                    setNameAndTypePB;
  5134.     DirGetRecordMetaInfoPB                getRecordMetaInfoPB;
  5135.     DirGetDNodeMetaInfoPB                getDNodeMetaInfoPB;
  5136.     DirGetDirectoryInfoPB                getDirectoryInfoPB;
  5137.  
  5138.     DirGetDNodeAccessControlGetPB         getDNodeAccessControlGetPB;
  5139.     DirGetDNodeAccessControlParsePB     getDNodeAccessControlParsePB;
  5140.  
  5141.     DirGetRecordAccessControlGetPB         getRecordAccessControlGetPB;
  5142.     DirGetRecordAccessControlParsePB     getRecordAccessControlParsePB;
  5143.  
  5144.     DirGetAttributeAccessControlGetPB     getAttributeAccessControlGetPB;
  5145.     DirGetAttributeAccessControlParsePB getAttributeAccessControlParsePB;
  5146.  
  5147.     DirEnumerateDirectoriesGetPB         enumerateDirectoriesGetPB;
  5148.     DirEnumerateDirectoriesParsePB         enumerateDirectoriesParsePB;
  5149.  
  5150.     DirAddADAPDirectoryPB                addADAPDirectoryPB;
  5151.     DirRemoveDirectoryPB                removeDirectoryPB;
  5152.     DirNetSearchADAPDirectoriesGetPB     netSearchADAPDirectoriesGetPB;
  5153.     DirNetSearchADAPDirectoriesParsePB     netSearchADAPDirectoriesParsePB;
  5154.     DirFindADAPDirectoryByNetSearchPB     findADAPDirectoryByNetSearchPB;
  5155.  
  5156.     DirMapDNodeNumberToPathNamePB         mapDNodeNumberToPathNamePB;
  5157.     DirMapPathNameToDNodeNumberPB         mapPathNameToDNodeNumberPB;
  5158.     DirGetLocalNetworkSpecPB            getLocalNetworkSpecPB;
  5159.     DirGetDNodeInfoPB                    getDNodeInfoPB;
  5160.  
  5161. /* Calls For Personal Catalogs */
  5162.     DirCreatePersonalDirectoryPB         createPersonalDirectoryPB;
  5163.     DirOpenPersonalDirectoryPB            openPersonalDirectoryPB;
  5164.     DirClosePersonalDirectoryPB            closePersonalDirectoryPB;
  5165.     DirMakePersonalDirectoryRLIPB         makePersonalDirectoryRLIPB;
  5166.  
  5167. /* Calls For CSAM's */
  5168.  
  5169.     DirAddDSAMPB                        addDSAMPB;
  5170.     DirInstantiateDSAMPB                instantiateDSAMPB;
  5171.     DirRemoveDSAMPB                        removeDSAMPB;
  5172.     DirAddDSAMDirectoryPB                addDSAMDirectoryPB;
  5173.     DirGetExtendedDirectoriesInfoPB     getExtendedDirectoriesInfoPB;
  5174.     DirGetDirectoryIconPB                getDirectoryIconPB;
  5175.  
  5176. /* Call to dsRefNum for System(OCE Setup) Personal Catalog */
  5177.     DirGetOCESetupRefNumPB                dirGetOCESetupRefNumPB;
  5178.  
  5179. /* Abort an aysnchronous call */
  5180.     DirAbortPB                            abortPB;
  5181. };
  5182. #if defined(powerc) || defined(__powerc)
  5183. #pragma options align=reset
  5184. #endif
  5185.  
  5186.  
  5187. /*************************************************************/
  5188. /*
  5189. These are the selector values used after the trap dispatch to determine just
  5190. what call the client made to my toolbox.  These bear no relationship to the
  5191. procedure numbers used in the client-to-server protocol.
  5192. */
  5193.  
  5194. /* Note:  0x21C, 0x21D are used internally
  5195.  */
  5196.  
  5197.  
  5198. #define kAuthBindSpecificIdentity 0x200
  5199. #define kAuthUnbindSpecificIdentity 0x201
  5200. #define kAuthResolveCreationID 0x202
  5201. #define kAuthGetSpecificIdentityInfo 0x203
  5202. #define kAuthGetLocalIdentity 0x204
  5203.  
  5204. #define kAuthAddToLocalIdentityQueue 0x205
  5205. #define kAuthRemoveFromLocalIdentityQueue 0x206
  5206.  
  5207. #define kAuthAddKey 0x207
  5208. #define kAuthChangeKey 0x208
  5209. #define kAuthDeleteKey 0x209
  5210. #define kAuthPasswordToKey 0x20A
  5211.  
  5212. #define kAuthGetCredentials 0x20B
  5213. #define kAuthDecryptCredentials 0x20C
  5214.  
  5215. #define kOCESetupRemoveDirectoryInfo 0x20D
  5216. #define kOCESetupGetDirectoryInfo 0x20E
  5217.  
  5218. #define kAuthMakeChallenge 0x20F
  5219. #define kAuthMakeReply 0x210
  5220. #define kAuthVerifyReply 0x211
  5221. #define kAuthMakeProxy 0x212
  5222. #define kAuthTradeProxyForCredentials 0x213
  5223.  
  5224. #define kAuthUnlockLocalIdentity 0x214
  5225. #define kAuthLockLocalIdentity 0x215
  5226. #define kAuthSetupLocalIdentity 0x216
  5227. #define kAuthChangeLocalIdentity 0x217
  5228. #define kAuthRemoveLocalIdentity 0x218
  5229. #define kOCESetupAddDirectoryInfo 0x219
  5230.  
  5231. #define kAuthGetUTCTime 0x21A
  5232.  
  5233. #define kOCESetupChangeDirectoryInfo 0x21B
  5234.  
  5235. /* 0x100 is used as private command */
  5236.  
  5237.  
  5238. #define kDirEnumerateParse 0x101
  5239. #define kDirLookupParse 0x102
  5240.  
  5241. #define kDirEnumerateAttributeTypesParse 0x103
  5242. #define kDirEnumeratePseudonymParse 0x104
  5243. #define kDirNetSearchADAPDirectoriesParse 0x105
  5244. #define kDirEnumerateDirectoriesParse 0x106
  5245.  
  5246. #define kDirFindADAPDirectoryByNetSearch 0x107
  5247. #define kDirNetSearchADAPDirectoriesGet 0x108
  5248.  
  5249. #define kDirAddRecord 0x109
  5250. #define kDirDeleteRecord 0x10A
  5251. #define kDirAddAttributeValue 0x10B
  5252. #define kDirDeleteAttributeValue 0x10C
  5253. #define kDirChangeAttributeValue 0x10D
  5254. #define kDirVerifyAttributeValue 0x10E
  5255. #define kDirAddPseudonym 0x10F
  5256. #define kDirDeletePseudonym 0x110
  5257. #define kDirEnumerateGet 0x111
  5258. #define kDirEnumerateAttributeTypesGet 0x112
  5259. #define kDirEnumeratePseudonymGet 0x113
  5260. #define kDirGetNameAndType 0x114
  5261. #define kDirSetNameAndType 0x115
  5262.  
  5263. #define kDirGetRecordMetaInfo 0x116
  5264. #define kDirLookupGet 0x117
  5265.  
  5266. #define kDirGetDNodeMetaInfo 0x118
  5267. #define kDirGetDirectoryInfo 0x119
  5268. #define kDirEnumerateDirectoriesGet 0x11A
  5269.  
  5270. #define kDirAbort 0x11B
  5271. #define kDirAddAlias 0x11C
  5272.  
  5273. #define kDirAddDSAM 0x11D
  5274. #define kDirOpenPersonalDirectory 0x11E
  5275. #define kDirCreatePersonalDirectory 0x11F
  5276. #define kDirRemoveDSAM 0x120
  5277. #define kDirGetDirectoryIcon 0x121
  5278.  
  5279. #define kDirMapPathNameToDNodeNumber 0x122
  5280. #define kDirMapDNodeNumberToPathName 0x123
  5281.  
  5282. #define kDirGetLocalNetworkSpec 0x124
  5283. #define kDirGetDNodeInfo 0x125
  5284. #define kDirFindValue 0x126
  5285. #define kDirInstantiateDSAM 0x127
  5286. #define kDirGetOCESetupRefNum 0x128
  5287.  
  5288. #define kDirGetDNodeAccessControlGet 0x12A
  5289. #define kDirGetRecordAccessControlGet 0x12C
  5290. #define kDirGetAttributeAccessControlGet 0x12E
  5291. #define kDirGetDNodeAccessControlParse 0x12F
  5292. #define kDirDeleteAttributeType 0x130
  5293.  
  5294. #define kDirClosePersonalDirectory 0x131
  5295. #define kDirMakePersonalDirectoryRLI 0x132
  5296.  
  5297. #define kDirAddDSAMDirectory 0x133
  5298. #define kDirGetRecordAccessControlParse 0x134
  5299. #define kDirRemoveDirectory 0x135
  5300. #define kDirGetExtendedDirectoriesInfo 0x136
  5301.  
  5302. #define kDirAddADAPDirectory 0x137
  5303. #define kDirGetAttributeAccessControlParse 0x138
  5304.  
  5305. #define kDirFindRecordGet 0x140
  5306. #define kDirFindRecordParse 0x141
  5307.  
  5308. #ifdef __cplusplus
  5309. extern "C" {
  5310. #endif
  5311.  
  5312. extern pascal OSErr AuthBindSpecificIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5313.  THREEWORDINLINE(0x3F3C, 0x200, 0xAA5E);
  5314. extern pascal OSErr AuthUnbindSpecificIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5315.  THREEWORDINLINE(0x3F3C, 0x201, 0xAA5E);
  5316. extern pascal OSErr AuthResolveCreationID(AuthParamBlockPtr paramBlock, Boolean async)
  5317.  THREEWORDINLINE(0x3F3C, 0x202, 0xAA5E);
  5318. extern pascal OSErr AuthGetSpecificIdentityInfo(AuthParamBlockPtr paramBlock, Boolean async)
  5319.  THREEWORDINLINE(0x3F3C, 0x203, 0xAA5E);
  5320. extern pascal OSErr AuthAddKey(AuthParamBlockPtr paramBlock, Boolean async)
  5321.  THREEWORDINLINE(0x3F3C, 0x207, 0xAA5E);
  5322. extern pascal OSErr AuthChangeKey(AuthParamBlockPtr paramBlock, Boolean async)
  5323.  THREEWORDINLINE(0x3F3C, 0x208, 0xAA5E);
  5324. extern pascal OSErr AuthDeleteKey(AuthParamBlockPtr paramBlock, Boolean async)
  5325.  THREEWORDINLINE(0x3F3C, 0x209, 0xAA5E);
  5326. extern pascal OSErr AuthPasswordToKey(AuthParamBlockPtr paramBlock, Boolean async)
  5327.  THREEWORDINLINE(0x3F3C, 0x20A, 0xAA5E);
  5328. extern pascal OSErr AuthGetCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  5329.  THREEWORDINLINE(0x3F3C, 0x20B, 0xAA5E);
  5330. extern pascal OSErr AuthDecryptCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  5331.  THREEWORDINLINE(0x3F3C, 0x20C, 0xAA5E);
  5332. extern pascal OSErr AuthMakeChallenge(AuthParamBlockPtr paramBlock, Boolean async)
  5333.  THREEWORDINLINE(0x3F3C, 0x20F, 0xAA5E);
  5334. extern pascal OSErr AuthMakeReply(AuthParamBlockPtr paramBlock, Boolean async)
  5335.  THREEWORDINLINE(0x3F3C, 0x210, 0xAA5E);
  5336. extern pascal OSErr AuthVerifyReply(AuthParamBlockPtr paramBlock, Boolean async)
  5337.  THREEWORDINLINE(0x3F3C, 0x211, 0xAA5E);
  5338. extern pascal OSErr AuthGetUTCTime(AuthParamBlockPtr paramBlock, Boolean async)
  5339.  THREEWORDINLINE(0x3F3C, 0x21A, 0xAA5E);
  5340. extern pascal OSErr AuthMakeProxy(AuthParamBlockPtr paramBlock, Boolean async)
  5341.  THREEWORDINLINE(0x3F3C, 0x212, 0xAA5E);
  5342. extern pascal OSErr AuthTradeProxyForCredentials(AuthParamBlockPtr paramBlock, Boolean async)
  5343.  THREEWORDINLINE(0x3F3C, 0x213, 0xAA5E);
  5344.  
  5345. /* Local Identity API */
  5346. extern pascal OSErr AuthGetLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5347.  THREEWORDINLINE(0x3F3C, 0x204, 0xAA5E);
  5348. extern pascal OSErr AuthUnlockLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5349.  THREEWORDINLINE(0x3F3C, 0x214, 0xAA5E);
  5350. extern pascal OSErr AuthLockLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5351.  THREEWORDINLINE(0x3F3C, 0x215, 0xAA5E);
  5352. extern pascal OSErr AuthAddToLocalIdentityQueue(AuthParamBlockPtr paramBlock, Boolean async)
  5353.  THREEWORDINLINE(0x3F3C, 0x205, 0xAA5E);
  5354. extern pascal OSErr AuthRemoveFromLocalIdentityQueue(AuthParamBlockPtr paramBlock, Boolean async)
  5355.  THREEWORDINLINE(0x3F3C, 0x206, 0xAA5E);
  5356. extern pascal OSErr AuthSetupLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5357.  THREEWORDINLINE(0x3F3C, 0x216, 0xAA5E);
  5358. extern pascal OSErr AuthChangeLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5359.  THREEWORDINLINE(0x3F3C, 0x217, 0xAA5E);
  5360. extern pascal OSErr AuthRemoveLocalIdentity(AuthParamBlockPtr paramBlock, Boolean async)
  5361.  THREEWORDINLINE(0x3F3C, 0x218, 0xAA5E);
  5362. extern pascal OSErr OCESetupAddDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  5363.  THREEWORDINLINE(0x3F3C, 0x219, 0xAA5E);
  5364. extern pascal OSErr OCESetupChangeDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  5365.  THREEWORDINLINE(0x3F3C, 0x21B, 0xAA5E);
  5366. extern pascal OSErr OCESetupRemoveDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  5367.  THREEWORDINLINE(0x3F3C, 0x20D, 0xAA5E);
  5368. extern pascal OSErr OCESetupGetDirectoryInfo(AuthParamBlockPtr paramBlock, Boolean async)
  5369.  THREEWORDINLINE(0x3F3C, 0x20E, 0xAA5E);
  5370.  
  5371. extern pascal OSErr DirAddRecord(DirParamBlockPtr paramBlock, Boolean async)
  5372.  THREEWORDINLINE(0x3F3C, 0x109, 0xAA5E);
  5373. extern pascal OSErr DirDeleteRecord(DirParamBlockPtr paramBlock, Boolean async)
  5374.  THREEWORDINLINE(0x3F3C, 0x10A, 0xAA5E);
  5375. extern pascal OSErr DirEnumerateGet(DirParamBlockPtr paramBlock, Boolean async)
  5376.  THREEWORDINLINE(0x3F3C, 0x111, 0xAA5E);
  5377. extern pascal OSErr DirEnumerateParse(DirParamBlockPtr paramBlock, Boolean async)
  5378.  THREEWORDINLINE(0x3F3C, 0x101, 0xAA5E);
  5379. extern pascal OSErr DirFindRecordGet(DirParamBlockPtr paramBlock, Boolean async)
  5380.  THREEWORDINLINE(0x3F3C, 0x140, 0xAA5E);
  5381. extern pascal OSErr DirFindRecordParse(DirParamBlockPtr paramBlock, Boolean async)
  5382.  THREEWORDINLINE(0x3F3C, 0x141, 0xAA5E);
  5383. extern pascal OSErr DirLookupGet(DirParamBlockPtr paramBlock, Boolean async)
  5384.  THREEWORDINLINE(0x3F3C, 0x117, 0xAA5E);
  5385. extern pascal OSErr DirLookupParse(DirParamBlockPtr paramBlock, Boolean async)
  5386.  THREEWORDINLINE(0x3F3C, 0x102, 0xAA5E);
  5387. extern pascal OSErr DirAddAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  5388.  THREEWORDINLINE(0x3F3C, 0x10B, 0xAA5E);
  5389. extern pascal OSErr DirDeleteAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  5390.  THREEWORDINLINE(0x3F3C, 0x10C, 0xAA5E);
  5391. extern pascal OSErr DirDeleteAttributeType(DirParamBlockPtr paramBlock, Boolean async)
  5392.  THREEWORDINLINE(0x3F3C, 0x130, 0xAA5E);
  5393. extern pascal OSErr DirChangeAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  5394.  THREEWORDINLINE(0x3F3C, 0x10D, 0xAA5E);
  5395. extern pascal OSErr DirVerifyAttributeValue(DirParamBlockPtr paramBlock, Boolean async)
  5396.  THREEWORDINLINE(0x3F3C, 0x10E, 0xAA5E);
  5397. extern pascal OSErr DirFindValue(DirParamBlockPtr paramBlock, Boolean async)
  5398.  THREEWORDINLINE(0x3F3C, 0x126, 0xAA5E);
  5399. extern pascal OSErr DirEnumerateAttributeTypesGet(DirParamBlockPtr paramBlock, Boolean async)
  5400.  THREEWORDINLINE(0x3F3C, 0x112, 0xAA5E);
  5401. extern pascal OSErr DirEnumerateAttributeTypesParse(DirParamBlockPtr paramBlock, Boolean async)
  5402.  THREEWORDINLINE(0x3F3C, 0x103, 0xAA5E);
  5403. extern pascal OSErr DirAddPseudonym(DirParamBlockPtr paramBlock, Boolean async)
  5404.  THREEWORDINLINE(0x3F3C, 0x10F, 0xAA5E);
  5405. extern pascal OSErr DirDeletePseudonym(DirParamBlockPtr paramBlock, Boolean async)
  5406.  THREEWORDINLINE(0x3F3C, 0x110, 0xAA5E);
  5407. extern pascal OSErr DirAddAlias(DirParamBlockPtr paramBlock, Boolean async)
  5408.  THREEWORDINLINE(0x3F3C, 0x11C, 0xAA5E);
  5409. extern pascal OSErr DirEnumeratePseudonymGet(DirParamBlockPtr paramBlock, Boolean async)
  5410.  THREEWORDINLINE(0x3F3C, 0x113, 0xAA5E);
  5411. extern pascal OSErr DirEnumeratePseudonymParse(DirParamBlockPtr paramBlock, Boolean async)
  5412.  THREEWORDINLINE(0x3F3C, 0x104, 0xAA5E);
  5413. extern pascal OSErr DirGetNameAndType(DirParamBlockPtr paramBlock, Boolean async)
  5414.  THREEWORDINLINE(0x3F3C, 0x114, 0xAA5E);
  5415. extern pascal OSErr DirSetNameAndType(DirParamBlockPtr paramBlock, Boolean async)
  5416.  THREEWORDINLINE(0x3F3C, 0x115, 0xAA5E);
  5417. extern pascal OSErr DirGetRecordMetaInfo(DirParamBlockPtr paramBlock, Boolean async)
  5418.  THREEWORDINLINE(0x3F3C, 0x116, 0xAA5E);
  5419. extern pascal OSErr DirGetDNodeMetaInfo(DirParamBlockPtr paramBlock, Boolean async)
  5420.  THREEWORDINLINE(0x3F3C, 0x118, 0xAA5E);
  5421. extern pascal OSErr DirGetDirectoryInfo(DirParamBlockPtr paramBlock, Boolean async)
  5422.  THREEWORDINLINE(0x3F3C, 0x119, 0xAA5E);
  5423. extern pascal OSErr DirGetDNodeAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  5424.  THREEWORDINLINE(0x3F3C, 0x12A, 0xAA5E);
  5425. extern pascal OSErr DirGetDNodeAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  5426.  THREEWORDINLINE(0x3F3C, 0x12F, 0xAA5E);
  5427. extern pascal OSErr DirGetRecordAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  5428.  THREEWORDINLINE(0x3F3C, 0x12C, 0xAA5E);
  5429. extern pascal OSErr DirGetRecordAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  5430.  THREEWORDINLINE(0x3F3C, 0x134, 0xAA5E);
  5431. extern pascal OSErr DirGetAttributeAccessControlGet(DirParamBlockPtr paramBlock, Boolean async)
  5432.  THREEWORDINLINE(0x3F3C, 0x12E, 0xAA5E);
  5433. extern pascal OSErr DirGetAttributeAccessControlParse(DirParamBlockPtr paramBlock, Boolean async)
  5434.  THREEWORDINLINE(0x3F3C, 0x138, 0xAA5E);
  5435. extern pascal OSErr DirEnumerateDirectoriesGet(DirParamBlockPtr paramBlock, Boolean async)
  5436.  THREEWORDINLINE(0x3F3C, 0x11A, 0xAA5E);
  5437. extern pascal OSErr DirEnumerateDirectoriesParse(DirParamBlockPtr paramBlock, Boolean async)
  5438.  THREEWORDINLINE(0x3F3C, 0x106, 0xAA5E);
  5439. extern pascal OSErr DirMapPathNameToDNodeNumber(DirParamBlockPtr paramBlock, Boolean async)
  5440.  THREEWORDINLINE(0x3F3C, 0x122, 0xAA5E);
  5441. extern pascal OSErr DirMapDNodeNumberToPathName(DirParamBlockPtr paramBlock, Boolean async)
  5442.  THREEWORDINLINE(0x3F3C, 0x123, 0xAA5E);
  5443.  
  5444. extern pascal OSErr DirGetLocalNetworkSpec(DirParamBlockPtr paramBlock, Boolean async)
  5445.  THREEWORDINLINE(0x3F3C, 0x124, 0xAA5E);
  5446. extern pascal OSErr DirGetDNodeInfo(DirParamBlockPtr paramBlock, Boolean async)
  5447.  THREEWORDINLINE(0x3F3C, 0x125, 0xAA5E);
  5448.  
  5449. /*  Trap Dispatchers for Personal Catalog and CSAM Extensions */
  5450.  
  5451. extern pascal OSErr DirCreatePersonalDirectory(DirParamBlockPtr paramBlock)
  5452.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11F, 0xAA5E);
  5453. extern pascal OSErr DirOpenPersonalDirectory(DirParamBlockPtr paramBlock)
  5454.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11E, 0xAA5E);
  5455. extern pascal OSErr DirClosePersonalDirectory(DirParamBlockPtr paramBlock)
  5456.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x131, 0xAA5E);
  5457. extern pascal OSErr DirMakePersonalDirectoryRLI(DirParamBlockPtr paramBlock)
  5458.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x132, 0xAA5E);
  5459. extern pascal OSErr DirAddDSAM(DirParamBlockPtr paramBlock)
  5460.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11D, 0xAA5E);
  5461. extern pascal OSErr DirInstantiateDSAM(DirParamBlockPtr paramBlock)
  5462.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x127, 0xAA5E);
  5463. extern pascal OSErr DirRemoveDSAM(DirParamBlockPtr paramBlock)
  5464.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x120, 0xAA5E);
  5465. extern pascal OSErr DirAddDSAMDirectory(DirParamBlockPtr paramBlock, Boolean async)
  5466.  THREEWORDINLINE(0x3F3C, 0x133, 0xAA5E);
  5467. extern pascal OSErr DirGetExtendedDirectoriesInfo(DirParamBlockPtr paramBlock, Boolean async)
  5468.  THREEWORDINLINE(0x3F3C, 0x136, 0xAA5E);
  5469. extern pascal OSErr DirGetDirectoryIcon(DirParamBlockPtr paramBlock, Boolean async)
  5470.  THREEWORDINLINE(0x3F3C, 0x121, 0xAA5E);
  5471. extern pascal OSErr DirAddADAPDirectory(DirParamBlockPtr paramBlock, Boolean async)
  5472.  THREEWORDINLINE(0x3F3C, 0x137, 0xAA5E);
  5473. extern pascal OSErr DirRemoveDirectory(DirParamBlockPtr paramBlock, Boolean async)
  5474.  THREEWORDINLINE(0x3F3C, 0x135, 0xAA5E);
  5475. extern pascal OSErr DirNetSearchADAPDirectoriesGet(DirParamBlockPtr paramBlock, Boolean async)
  5476.  THREEWORDINLINE(0x3F3C, 0x108, 0xAA5E);
  5477. extern pascal OSErr DirNetSearchADAPDirectoriesParse(DirParamBlockPtr paramBlock, Boolean async)
  5478.  THREEWORDINLINE(0x3F3C, 0x105, 0xAA5E);
  5479. extern pascal OSErr DirFindADAPDirectoryByNetSearch(DirParamBlockPtr paramBlock, Boolean async)
  5480.  THREEWORDINLINE(0x3F3C, 0x107, 0xAA5E);
  5481. extern pascal OSErr DirGetOCESetupRefNum(DirParamBlockPtr paramBlock, Boolean async)
  5482.  THREEWORDINLINE(0x3F3C, 0x128, 0xAA5E);
  5483. extern pascal OSErr DirAbort(DirParamBlockPtr paramBlock)
  5484.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x11B, 0xAA5E);
  5485. #ifdef __cplusplus
  5486. }
  5487. #endif
  5488.  
  5489. #endif
  5490.  
  5491.